@quoin-cms/admin 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -1
- package/src/AdminRoot.svelte +5 -1
- package/src/lib/api/auth.ts +3 -6
- package/src/lib/api/files.ts +3 -2
- package/src/lib/components/AdminSidebar.svelte +23 -2
- package/src/lib/components/DocumentEditLayout.svelte +17 -0
- package/src/lib/components/DynamicForm.svelte +3 -3
- package/src/lib/components/MediaLibrary.svelte +55 -7
- package/src/lib/components/UploadCreateView.svelte +173 -0
- package/src/lib/components/doc/ApiView.svelte +95 -103
- package/src/lib/components/doc/RenderJson.svelte +93 -0
- package/src/lib/components/fields/RichTextField.svelte +5 -0
- package/src/lib/components/fields/UploadField.svelte +26 -34
- package/src/lib/components/fields/UploadGalleryField.svelte +28 -37
- package/src/lib/components/lexical/BlockField.svelte +41 -0
- package/src/lib/components/lexical/BlockHost.svelte +85 -0
- package/src/lib/components/lexical/BlockNode.ts +102 -0
- package/src/lib/components/lexical/block-defaults.ts +40 -0
- package/src/lib/components/lexical/lexical-helpers.ts +3 -0
- package/src/lib/components/lexical/nodes.ts +2 -0
- package/src/lib/components/lexical/toolbar/InsertBlockDropdown.svelte +27 -2
- package/src/lib/context.svelte.ts +1 -0
- package/src/lib/types/schema.ts +5 -0
- package/src/views/CollectionNewView.svelte +3 -0
- package/src/views/LoginView.svelte +47 -23
- package/biome.json +0 -62
- package/dist/assets/index-BaOy5Of3.js +0 -32
- package/dist/assets/index-DINUk481.css +0 -1
- package/dist/index.html +0 -20
- package/tsconfig.json +0 -25
- package/vite.config.ts +0 -80
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function t(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=t(i);fetch(i.href,o)}})();const hg=!1;var Mu=Array.isArray,nm=Array.prototype.indexOf,Xi=Array.prototype.includes,wa=Array.from,vg=Object.defineProperty,Mr=Object.getOwnPropertyDescriptor,pg=Object.getOwnPropertyDescriptors,rm=Object.prototype,im=Array.prototype,Pu=Object.getPrototypeOf,Kc=Object.isExtensible;function So(n){return typeof n=="function"}const Ot=()=>{};function om(n){return typeof n?.then=="function"}function sm(n){return n()}function Fl(n){for(var e=0;e<n.length;e++)n[e]()}function mg(){var n,e,t=new Promise((r,i)=>{n=r,e=i});return{promise:t,resolve:n,reject:e}}function _g(n,e){if(Array.isArray(n))return n;if(!(Symbol.iterator in n))return Array.from(n);const t=[];for(const r of n)if(t.push(r),t.length===e)break;return t}const Zt=2,Qi=4,es=8,Du=1<<24,Fn=16,zn=32,Lr=64,Il=128,kn=512,Lt=1024,Wt=2048,nr=4096,sn=8192,Cn=16384,vi=32768,Ll=1<<25,_r=65536,Zs=1<<17,am=1<<18,fo=1<<19,bg=1<<20,qn=1<<25,ii=65536,Xs=1<<21,Ui=1<<22,Pr=1<<23,Yn=Symbol("$state"),yg=Symbol("legacy props"),lm=Symbol(""),xg=Symbol("attributes"),Rl=Symbol("class"),zl=Symbol("style"),Bl=Symbol("text"),Us=Symbol("form reset"),Sa=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Fu=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");function Iu(n){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function um(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function cm(n,e,t){throw new Error("https://svelte.dev/e/each_key_duplicate")}function dm(n){throw new Error("https://svelte.dev/e/effect_in_teardown")}function fm(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function gm(n){throw new Error("https://svelte.dev/e/effect_orphan")}function hm(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function vm(n){throw new Error("https://svelte.dev/e/props_invalid_value")}function pm(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function mm(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function _m(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function bm(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const ym=1,xm=2,wg=4,wm=8,Sm=16,km=1,Cm=2,Sg=4,Em=8,Tm=16,Nm=1,Am=2,At=Symbol("uninitialized"),kg="http://www.w3.org/1999/xhtml",Cg="http://www.w3.org/2000/svg",Om="http://www.w3.org/1998/Math/MathML",Mm="@attach";function Pm(){console.warn("https://svelte.dev/e/derived_inert")}function Dm(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Fm(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Eg(n){return n===this.v}function Tg(n,e){return n!=n?e==e:n!==e||n!==null&&typeof n=="object"||typeof n=="function"}function Ng(n){return!Tg(n,this.v)}let go=!1,Im=!1;function Lm(){go=!0}let pt=null;function $i(n){pt=n}function eo(n){return ka().get(n)}function pi(n,e){return ka().set(n,e),e}function Rm(n){return ka().has(n)}function zm(){return ka()}function ce(n,e=!1,t){pt={p:pt,i:!1,c:null,e:null,s:n,x:null,r:We,l:go&&!e?{s:null,u:null,$:[]}:null}}function de(n){var e=pt,t=e.e;if(t!==null){e.e=null;for(var r of t)Xg(r)}return n!==void 0&&(e.x=n),e.i=!0,pt=e.p,n??{}}function ho(){return!go||pt!==null&&pt.l===null}function ka(n){return pt===null&&Iu(),pt.c??=new Map(Bm(pt)||void 0)}function Bm(n){let e=n.p;for(;e!==null;){const t=e.c;if(t!==null)return t;e=e.p}return null}let Yr=[];function Ag(){var n=Yr;Yr=[],Fl(n)}function Zn(n){if(Yr.length===0&&!Ki){var e=Yr;queueMicrotask(()=>{e===Yr&&Ag()})}Yr.push(n)}function Um(){for(;Yr.length>0;)Ag()}function Og(n){var e=We;if(e===null)return Qe.f|=Pr,n;if((e.f&vi)===0&&(e.f&Qi)===0)throw n;Tr(n,e)}function Tr(n,e){for(;e!==null;){if((e.f&Il)!==0){if((e.f&vi)===0)throw n;try{e.b.error(n);return}catch(t){n=t}}e=e.parent}throw n}const jm=-7169;function Et(n,e){n.f=n.f&jm|e}function Lu(n){(n.f&kn)!==0||n.deps===null?Et(n,Lt):Et(n,nr)}function Mg(n){if(n!==null)for(const e of n)(e.f&Zt)===0||(e.f&ii)===0||(e.f^=ii,Mg(e.deps))}function Pg(n,e,t){(n.f&Wt)!==0?e.add(n):(n.f&nr)!==0&&t.add(n),Mg(n.deps),Et(n,Lt)}function Dg(n,e,t){if(n==null)return e(void 0),Ot;const r=Xt(()=>n.subscribe(e,t));return r.unsubscribe?()=>r.unsubscribe():r}const Ci=[];function Ru(n,e=Ot){let t=null;const r=new Set;function i(a){if(Tg(n,a)&&(n=a,t)){const u=!Ci.length;for(const c of r)c[1](),Ci.push(c,n);if(u){for(let c=0;c<Ci.length;c+=2)Ci[c][0](Ci[c+1]);Ci.length=0}}}function o(a){i(a(n))}function s(a,u=Ot){const c=[a,u];return r.add(c),r.size===1&&(t=e(i,o)||Ot),a(n),()=>{r.delete(c),r.size===0&&t&&(t(),t=null)}}return{set:i,update:o,subscribe:s}}function Wm(n){let e;return Dg(n,t=>e=t)(),e}let Ul=!1,ws=!1,jl=Symbol("unmounted");function ji(n,e,t){const r=t[e]??={store:null,source:$s(void 0),unsubscribe:Ot};if(r.store!==n&&!(jl in t))if(r.unsubscribe(),r.store=n??null,n==null)r.source.v=void 0,r.unsubscribe=Ot;else{var i=!0;r.unsubscribe=Dg(n,o=>{i?r.source.v=o:A(r.source,o)}),i=!1}return n&&jl in t?Wm(n):l(r.source)}function Wi(n,e){return Km(n,e),e}function Ca(){const n={};function e(){ns(()=>{for(var t in n)n[t].unsubscribe();vg(n,jl,{enumerable:!1,value:!0})})}return[n,e]}function Km(n,e){Ul=!0;try{n.set(e)}finally{Ul=!1}}function Hm(n){var e=ws;try{return ws=!1,[n(),ws]}finally{ws=e}}let tl=null,Ei=null,Ue=null,Wl=null,In=null,Kl=null,Ki=!1,nl=!1,Ri=null,js=null;var Hc=0;let Vm=1;class br{id=Vm++;#e=!1;linked=!0;#n=null;#t=null;async_deriveds=new Map;current=new Map;previous=new Map;unblocked=new Set;#l=new Set;#r=new Set;#o=new Set;#i=0;#s=new Map;#f=null;#a=[];#h=[];#g=new Set;#u=new Set;#c=new Map;#d=new Set;is_fork=!1;#p=!1;#w(){if(this.is_fork)return!0;for(const r of this.#s.keys()){for(var e=r,t=!1;e.parent!==null;){if(this.#c.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(e){this.#c.has(e)||this.#c.set(e,{d:[],m:[]}),this.#d.delete(e)}unskip_effect(e,t=r=>this.schedule(r)){var r=this.#c.get(e);if(r){this.#c.delete(e);for(var i of r.d)Et(i,Wt),t(i);for(i of r.m)Et(i,nr),t(i)}this.#d.add(e)}#m(){if(this.#e=!0,Hc++>1e3&&(this.#y(),Jm()),!this.#w()){for(const u of this.#g)this.#u.delete(u),Et(u,Wt),this.schedule(u);for(const u of this.#u)Et(u,nr),this.schedule(u)}const e=this.#a;this.#a=[],this.apply();var t=Ri=[],r=[],i=js=[];for(const u of e)try{this.#S(u,t,r)}catch(c){throw Rg(u),c}if(Ue=null,i.length>0){var o=br.ensure();for(const u of i)o.schedule(u)}if(Ri=null,js=null,this.#w()){this.#v(r),this.#v(t);for(const[u,c]of this.#c)Lg(u,c);i.length>0&&Ue.#m();return}const s=this.#x();if(s){s.#_(this);return}this.#g.clear(),this.#u.clear();for(const u of this.#l)u(this);this.#l.clear(),Wl=this,Vc(r),Vc(t),Wl=null,this.#f?.resolve();var a=Ue;if(this.linked&&this.#i===0&&this.#y(),this.#a.length>0){a===null&&(a=this,this.#b());const u=a;u.#a.push(...this.#a.filter(c=>!u.#a.includes(c)))}a!==null&&a.#m()}#S(e,t,r){e.f^=Lt;for(var i=e.first;i!==null;){var o=i.f,s=(o&(zn|Lr))!==0,a=s&&(o&Lt)!==0,u=a||(o&sn)!==0||this.#c.has(i);if(!u&&i.fn!==null){s?i.f^=Lt:(o&Qi)!==0?t.push(i):rs(i)&&((o&Fn)!==0&&this.#u.add(i),no(i));var c=i.first;if(c!==null){i=c;continue}}for(;i!==null;){var d=i.next;if(d!==null){i=d;break}i=i.parent}}}#x(){for(var e=this.#n;e!==null;){if(!e.is_fork){for(const[t,[,r]]of this.current)if(e.current.has(t)&&!r)return e}e=e.#n}return null}#_(e){for(const[r,i]of e.current)!this.previous.has(r)&&e.previous.has(r)&&this.previous.set(r,e.previous.get(r)),this.current.set(r,i);for(const[r,i]of e.async_deriveds){const o=this.async_deriveds.get(r);o&&i.promise.then(o.resolve)}const t=r=>{var i=r.reactions;if(i!==null)for(const a of i){var o=a.f;if((o&Zt)!==0)t(a);else{var s=a;o&(Ui|Fn)&&!this.async_deriveds.has(s)&&(this.#u.delete(s),Et(s,Wt),this.schedule(s))}}};for(const r of this.current.keys())t(r);this.oncommit(()=>e.discard()),e.#y(),Ue=this,this.#m()}#v(e){for(var t=0;t<e.length;t+=1)Pg(e[t],this.#g,this.#u)}capture(e,t,r=!1){e.v!==At&&!this.previous.has(e)&&this.previous.set(e,e.v),(e.f&Pr)===0&&(this.current.set(e,[t,r]),In?.set(e,t)),this.is_fork||(e.v=t)}activate(){Ue=this}deactivate(){Ue=null,In=null}flush(){try{nl=!0,Ue=this,this.#m()}finally{Hc=0,Kl=null,Ri=null,js=null,nl=!1,Ue=null,In=null,Xr.clear()}}discard(){for(const e of this.#r)e(this);this.#r.clear(),this.#o.clear(),this.#y()}register_created_effect(e){this.#h.push(e)}#k(){this.#y();for(let d=tl;d!==null;d=d.#t){var e=d.id<this.id,t=[];for(const[f,[g,p]]of this.current){if(d.current.has(f)){var r=d.current.get(f)[0];if(e&&g!==r)d.current.set(f,[g,p]);else continue}t.push(f)}if(e)for(const[f,g]of this.async_deriveds){const p=d.async_deriveds.get(f);p&&g.promise.then(p.resolve)}if(d.#e){var i=[...d.current.keys()].filter(f=>!this.current.has(f));if(i.length===0)e&&d.discard();else if(t.length>0){if(e)for(const f of this.#d)d.unskip_effect(f,g=>{(g.f&(Fn|Ui))!==0?d.schedule(g):d.#v([g])});d.activate();var o=new Set,s=new Map;for(var a of t)Ig(a,i,o,s);s=new Map;var u=[...d.current.keys()].filter(f=>this.current.has(f)?this.current.get(f)[0]!==f.v:!0);if(u.length>0)for(const f of this.#h)(f.f&(Cn|sn|Zs))===0&&zu(f,u,s)&&((f.f&(Ui|Fn))!==0?(Et(f,Wt),d.schedule(f)):d.#g.add(f));if(d.#a.length>0){d.apply();for(var c of d.#a)d.#S(c,[],[]);d.#a=[]}d.deactivate()}}}}increment(e,t){if(this.#i+=1,e){let r=this.#s.get(t)??0;this.#s.set(t,r+1)}}decrement(e,t){if(this.#i-=1,e){let r=this.#s.get(t)??0;r===1?this.#s.delete(t):this.#s.set(t,r-1)}this.#p||(this.#p=!0,Zn(()=>{this.#p=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(const r of e)this.#g.add(r);for(const r of t)this.#u.add(r);e.clear(),t.clear()}oncommit(e){this.#l.add(e)}ondiscard(e){this.#r.add(e)}on_fork_commit(e){this.#o.add(e)}run_fork_commit_callbacks(){for(const e of this.#o)e(this);this.#o.clear()}settled(){return(this.#f??=mg()).promise}static ensure(){if(Ue===null){const e=Ue=new br;e.#b(),!nl&&!Ki&&Zn(()=>{e.#e||e.flush()})}return Ue}apply(){{In=null;return}}schedule(e){if(Kl=e,e.b?.is_pending&&(e.f&(Qi|es|Du))!==0&&(e.f&vi)===0){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var r=t.f;if(Ri!==null&&t===We&&(Qe===null||(Qe.f&Zt)===0)&&!Ul)return;if((r&(Lr|zn))!==0){if((r&Lt)===0)return;t.f^=Lt}}this.#a.push(t)}#b(){Ei===null?tl=Ei=this:(Ei.#t=this,this.#n=Ei),Ei=this}#y(){var e=this.#n,t=this.#t;e===null?tl=t:e.#t=t,t===null?Ei=e:t.#n=e,this.linked=!1}}function Fg(n){var e=Ki;Ki=!0;try{for(var t;;){if(Um(),Ue===null)return t;Ue.flush()}}finally{Ki=e}}function Jm(){try{hm()}catch(n){Tr(n,Kl)}}let gr=null;function Vc(n){var e=n.length;if(e!==0){for(var t=0;t<e;){var r=n[t++];if((r.f&(Cn|sn))===0&&rs(r)&&(gr=new Set,no(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&th(r),gr?.size>0)){Xr.clear();for(const i of gr){if((i.f&(Cn|sn))!==0)continue;const o=[i];let s=i.parent;for(;s!==null;)gr.has(s)&&(gr.delete(s),o.push(s)),s=s.parent;for(let a=o.length-1;a>=0;a--){const u=o[a];(u.f&(Cn|sn))===0&&no(u)}}gr.clear()}}gr=null}}function Ig(n,e,t,r){if(!t.has(n)&&(t.add(n),n.reactions!==null))for(const i of n.reactions){const o=i.f;(o&Zt)!==0?Ig(i,e,t,r):(o&(Ui|Fn))!==0&&(o&Wt)===0&&zu(i,e,r)&&(Et(i,Wt),Bu(i))}}function zu(n,e,t){const r=t.get(n);if(r!==void 0)return r;if(n.deps!==null)for(const i of n.deps){if(Xi.call(e,i))return!0;if((i.f&Zt)!==0&&zu(i,e,t))return t.set(i,!0),!0}return t.set(n,!1),!1}function Bu(n){Ue.schedule(n)}function Lg(n,e){if(!((n.f&zn)!==0&&(n.f&Lt)!==0)){(n.f&Wt)!==0?e.d.push(n):(n.f&nr)!==0&&e.m.push(n),Et(n,Lt);for(var t=n.first;t!==null;)Lg(t,e),t=t.next}}function Rg(n){Et(n,Lt);for(var e=n.first;e!==null;)Rg(e),e=e.next}function zg(n){let e=0,t=rr(0),r;return()=>{Hu()&&(l(t),Na(()=>(e===0&&(r=Xt(()=>n(()=>Do(t)))),e+=1,()=>{Zn(()=>{e-=1,e===0&&(r?.(),r=void 0,Do(t))})})))}}var qm=_r|fo;function Gm(n,e,t,r){new Ym(n,e,t,r)}class Ym{parent;is_pending=!1;transform_error;#e;#n=null;#t;#l;#r;#o=null;#i=null;#s=null;#f=null;#a=0;#h=0;#g=!1;#u=new Set;#c=new Set;#d=null;#p=zg(()=>(this.#d=rr(this.#a),()=>{this.#d=null}));constructor(e,t,r,i){this.#e=e,this.#t=t,this.#l=o=>{var s=We;s.b=this,s.f|=Il,r(o)},this.parent=We.b,this.transform_error=i??this.parent?.transform_error??(o=>o),this.#r=mi(()=>{this.#x()},qm)}#w(){try{this.#o=ln(()=>this.#l(this.#e))}catch(e){this.error(e)}}#m(e){const t=this.#t.failed;t&&(this.#s=ln(()=>{t(this.#e,()=>e,()=>()=>{})}))}#S(){const e=this.#t.pending;e&&(this.is_pending=!0,this.#i=ln(()=>e(this.#e)),Zn(()=>{var t=this.#f=document.createDocumentFragment(),r=Xn();t.append(r),this.#o=this.#v(()=>ln(()=>this.#l(r))),this.#h===0&&(this.#e.before(t),this.#f=null,Qr(this.#i,()=>{this.#i=null}),this.#_(Ue))}))}#x(){try{if(this.is_pending=this.has_pending_snippet(),this.#h=0,this.#a=0,this.#o=ln(()=>{this.#l(this.#e)}),this.#h>0){var e=this.#f=document.createDocumentFragment();qu(this.#o,e);const t=this.#t.pending;this.#i=ln(()=>t(this.#e))}else this.#_(Ue)}catch(t){this.error(t)}}#_(e){this.is_pending=!1,e.transfer_effects(this.#u,this.#c)}defer_effect(e){Pg(e,this.#u,this.#c)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#t.pending}#v(e){var t=We,r=Qe,i=pt;An(this.#r),Nn(this.#r),$i(this.#r.ctx);try{return br.ensure(),e()}catch(o){return Og(o),null}finally{An(t),Nn(r),$i(i)}}#k(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#k(e,t);return}this.#h+=e,this.#h===0&&(this.#_(t),this.#i&&Qr(this.#i,()=>{this.#i=null}),this.#f&&(this.#e.before(this.#f),this.#f=null))}update_pending_count(e,t){this.#k(e,t),this.#a+=e,!(!this.#d||this.#g)&&(this.#g=!0,Zn(()=>{this.#g=!1,this.#d&&pr(this.#d,this.#a)}))}get_effect_pending(){return this.#p(),l(this.#d)}error(e){if(!this.#t.onerror&&!this.#t.failed)throw e;Ue?.is_fork?(this.#o&&Ue.skip_effect(this.#o),this.#i&&Ue.skip_effect(this.#i),this.#s&&Ue.skip_effect(this.#s),Ue.on_fork_commit(()=>{this.#b(e)})):this.#b(e)}#b(e){this.#o&&(Gt(this.#o),this.#o=null),this.#i&&(Gt(this.#i),this.#i=null),this.#s&&(Gt(this.#s),this.#s=null);var t=this.#t.onerror;let r=this.#t.failed;var i=!1,o=!1;const s=()=>{if(i){Fm();return}i=!0,o&&bm(),this.#s!==null&&Qr(this.#s,()=>{this.#s=null}),this.#v(()=>{this.#x()})},a=u=>{try{o=!0,t?.(u,s),o=!1}catch(c){Tr(c,this.#r&&this.#r.parent)}r&&(this.#s=this.#v(()=>{try{return ln(()=>{var c=We;c.b=this,c.f|=Il,r(this.#e,()=>u,()=>s)})}catch(c){return Tr(c,this.#r.parent),null}}))};Zn(()=>{var u;try{u=this.transform_error(e)}catch(c){Tr(c,this.#r&&this.#r.parent);return}u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(a,c=>Tr(c,this.#r&&this.#r.parent)):a(u)})}}function Bg(n,e,t,r){const i=ho()?to:Uu;var o=n.filter(g=>!g.settled);if(t.length===0&&o.length===0){r(e.map(i));return}var s=We,a=Ug(),u=o.length===1?o[0].promise:o.length>1?Promise.all(o.map(g=>g.promise)):null;function c(g){if((s.f&Cn)===0){a();try{r(g)}catch(p){Tr(p,s)}Uo()}}var d=jg();if(t.length===0){u.then(()=>c(e.map(i))).finally(d);return}function f(){Promise.all(t.map(g=>Zm(g))).then(g=>c([...e.map(i),...g])).catch(g=>Tr(g,s)).finally(d)}u?u.then(()=>{a(),f(),Uo()}):f()}function Ug(){var n=We,e=Qe,t=pt,r=Ue;return function(o=!0){An(n),Nn(e),$i(t),o&&(n.f&Cn)===0&&(r?.activate(),r?.apply())}}function Uo(n=!0){An(null),Nn(null),$i(null),n&&Ue?.deactivate()}function jg(){var n=We,e=n.b,t=Ue,r=e.is_rendered();return e.update_pending_count(1,t),t.increment(r,n),()=>{e.update_pending_count(-1,t),t.decrement(r,n)}}function to(n){var e=Zt|Wt;return We!==null&&(We.f|=fo),{ctx:pt,deps:null,effects:null,equals:Eg,f:e,fn:n,reactions:null,rv:0,v:At,wv:0,parent:We,ac:null}}const Ss=Symbol("obsolete");function Zm(n,e,t){let r=We;r===null&&um();var i=void 0,o=rr(At),s=!Qe,a=new Set;return l_(()=>{var u=We,c=mg();i=c.promise;try{Promise.resolve(n()).then(c.resolve,p=>{p!==Sa&&c.reject(p)}).finally(Uo)}catch(p){c.reject(p),Uo()}var d=Ue;if(s){if((u.f&vi)!==0)var f=jg();if(r.b.is_rendered())d.async_deriveds.get(u)?.reject(Ss);else for(const p of a.values())p.reject(Ss);a.add(c),d.async_deriveds.set(u,c)}const g=(p,v=void 0)=>{f?.(),a.delete(c),v!==Ss&&(d.activate(),v?(o.f|=Pr,pr(o,v)):((o.f&Pr)!==0&&(o.f^=Pr),pr(o,p)),d.deactivate())};c.promise.then(g,p=>g(null,p||"unknown"))}),ns(()=>{for(const u of a)u.reject(Ss)}),new Promise(u=>{function c(d){function f(){d===i?u(o):c(i)}d.then(f,f)}c(i)})}function U(n){const e=to(n);return ih(e),e}function Uu(n){const e=to(n);return e.equals=Ng,e}function Xm(n){var e=n.effects;if(e!==null){n.effects=null;for(var t=0;t<e.length;t+=1)Gt(e[t])}}function ju(n){var e,t=We,r=n.parent;if(!yr&&r!==null&&n.v!==At&&(r.f&(Cn|sn))!==0)return Pm(),n.v;An(r);try{n.f&=~ii,Xm(n),e=lh(n)}finally{An(t)}return e}function Wg(n){var e=ju(n);if(!n.equals(e)&&(n.wv=sh(),(!Ue?.is_fork||n.deps===null)&&(Ue!==null?(Ue.capture(n,e,!0),Wl?.capture(n,e,!0)):n.v=e,n.deps===null))){Et(n,Lt);return}yr||(In!==null?(Hu()||Ue?.is_fork)&&In.set(n,e):Lu(n))}function Qm(n){if(n.effects!==null)for(const e of n.effects)(e.teardown||e.ac)&&(e.teardown?.(),e.ac?.abort(Sa),e.fn!==null&&(e.teardown=Ot),e.ac=null,Wo(e,0),Vu(e))}function Kg(n){if(n.effects!==null)for(const e of n.effects)e.teardown&&e.fn!==null&&no(e)}let Qs=new Set;const Xr=new Map;let Hg=!1;function rr(n,e){var t={f:0,v:n,reactions:null,equals:Eg,rv:0,wv:0};return t}function X(n,e){const t=rr(n);return ih(t),t}function $s(n,e=!1,t=!0){const r=rr(n);return e||(r.equals=Ng),go&&t&&pt!==null&&pt.l!==null&&(pt.l.s??=[]).push(r),r}function A(n,e,t=!1){Qe!==null&&(!Ln||(Qe.f&Zs)!==0)&&ho()&&(Qe.f&(Zt|Fn|Ui|Zs))!==0&&(En===null||!Xi.call(En,n))&&_m();let r=t?Be(e):e;return pr(n,r,js)}function pr(n,e,t=null){if(!n.equals(e)){Xr.set(n,yr?e:n.v);var r=br.ensure();if(r.capture(n,e),(n.f&Zt)!==0){const i=n;(n.f&Wt)!==0&&ju(i),In===null&&Lu(i)}n.wv=sh(),Vg(n,Wt,t),ho()&&We!==null&&(We.f&Lt)!==0&&(We.f&(zn|Lr))===0&&(yn===null?c_([n]):yn.push(n)),!r.is_fork&&Qs.size>0&&!Hg&&$m()}return e}function $m(){Hg=!1;for(const n of Qs){(n.f&Lt)!==0&&Et(n,nr);let e;try{e=rs(n)}catch{e=!0}e&&no(n)}Qs.clear()}function ea(n,e=1){var t=l(n),r=e===1?t++:t--;return A(n,t),r}function Do(n){A(n,n.v+1)}function Vg(n,e,t){var r=n.reactions;if(r!==null)for(var i=ho(),o=r.length,s=0;s<o;s++){var a=r[s],u=a.f;if(!(!i&&a===We)){var c=(u&Wt)===0;if(c&&Et(a,e),(u&Zs)!==0)Qs.add(a);else if((u&Zt)!==0){var d=a;In?.delete(d),(u&ii)===0&&(u&kn&&(We===null||(We.f&Xs)===0)&&(a.f|=ii),Vg(d,nr,t))}else if(c){var f=a;(u&Fn)!==0&&gr!==null&&gr.add(f),t!==null?t.push(f):Bu(f)}}}}function Be(n){if(typeof n!="object"||n===null||Yn in n)return n;const e=Pu(n);if(e!==rm&&e!==im)return n;var t=new Map,r=Mu(n),i=X(0),o=$r,s=a=>{if($r===o)return a();var u=Qe,c=$r;Nn(null),Yc(o);var d=a();return Nn(u),Yc(c),d};return r&&t.set("length",X(n.length)),new Proxy(n,{defineProperty(a,u,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&pm();var d=t.get(u);return d===void 0?s(()=>{var f=X(c.value);return t.set(u,f),f}):A(d,c.value,!0),!0},deleteProperty(a,u){var c=t.get(u);if(c===void 0){if(u in a){const d=s(()=>X(At));t.set(u,d),Do(i)}}else A(c,At),Do(i);return!0},get(a,u,c){if(u===Yn)return n;var d=t.get(u),f=u in a;if(d===void 0&&(!f||Mr(a,u)?.writable)&&(d=s(()=>{var p=Be(f?a[u]:At),v=X(p);return v}),t.set(u,d)),d!==void 0){var g=l(d);return g===At?void 0:g}return Reflect.get(a,u,c)},getOwnPropertyDescriptor(a,u){var c=Reflect.getOwnPropertyDescriptor(a,u);if(c&&"value"in c){var d=t.get(u);d&&(c.value=l(d))}else if(c===void 0){var f=t.get(u),g=f?.v;if(f!==void 0&&g!==At)return{enumerable:!0,configurable:!0,value:g,writable:!0}}return c},has(a,u){if(u===Yn)return!0;var c=t.get(u),d=c!==void 0&&c.v!==At||Reflect.has(a,u);if(c!==void 0||We!==null&&(!d||Mr(a,u)?.writable)){c===void 0&&(c=s(()=>{var g=d?Be(a[u]):At,p=X(g);return p}),t.set(u,c));var f=l(c);if(f===At)return!1}return d},set(a,u,c,d){var f=t.get(u),g=u in a;if(r&&u==="length")for(var p=c;p<f.v;p+=1){var v=t.get(p+"");v!==void 0?A(v,At):p in a&&(v=s(()=>X(At)),t.set(p+"",v))}if(f===void 0)(!g||Mr(a,u)?.writable)&&(f=s(()=>X(void 0)),A(f,Be(c)),t.set(u,f));else{g=f.v!==At;var m=s(()=>Be(c));A(f,m)}var h=Reflect.getOwnPropertyDescriptor(a,u);if(h?.set&&h.set.call(d,c),!g){if(r&&typeof u=="string"){var x=t.get("length"),_=Number(u);Number.isInteger(_)&&_>=x.v&&A(x,_+1)}Do(i)}return!0},ownKeys(a){l(i);var u=Reflect.ownKeys(a).filter(f=>{var g=t.get(f);return g===void 0||g.v!==At});for(var[c,d]of t)d.v!==At&&!(c in a)&&u.push(c);return u},setPrototypeOf(){mm()}})}function Jc(n){try{if(n!==null&&typeof n=="object"&&Yn in n)return n[Yn]}catch{}return n}function e_(n,e){return Object.is(Jc(n),Jc(e))}var jo,Jg,qg,Gg;function t_(){if(jo===void 0){jo=window,Jg=/Firefox/.test(navigator.userAgent);var n=Element.prototype,e=Node.prototype,t=Text.prototype;qg=Mr(e,"firstChild").get,Gg=Mr(e,"nextSibling").get,Kc(n)&&(n[Rl]=void 0,n[xg]=null,n[zl]=void 0,n.__e=void 0),Kc(t)&&(t[Bl]=void 0)}}function Xn(n=""){return document.createTextNode(n)}function Gn(n){return qg.call(n)}function ts(n){return Gg.call(n)}function w(n,e){return Gn(n)}function q(n,e=!1){{var t=Gn(n);return t instanceof Comment&&t.data===""?ts(t):t}}function N(n,e=1,t=!1){let r=n;for(;e--;)r=ts(r);return r}function n_(n){n.textContent=""}function Yg(){return!1}function Wu(n,e,t){return document.createElementNS(e??kg,n,void 0)}function r_(n,e){if(e){const t=document.body;n.autofocus=!0,Zn(()=>{document.activeElement===t&&n.focus()})}}let qc=!1;function i_(){qc||(qc=!0,document.addEventListener("reset",n=>{Promise.resolve().then(()=>{if(!n.defaultPrevented)for(const e of n.target.elements)e[Us]?.()})},{capture:!0}))}function Ea(n){var e=Qe,t=We;Nn(null),An(null);try{return n()}finally{Nn(e),An(t)}}function Ku(n,e,t,r=t){n.addEventListener(e,()=>Ea(t));const i=n[Us];i?n[Us]=()=>{i(),r(!0)}:n[Us]=()=>r(!0),i_()}function Zg(n){We===null&&(Qe===null&&gm(),fm()),yr&&dm()}function o_(n,e){var t=e.last;t===null?e.last=e.first=n:(t.next=n,n.prev=t,e.last=n)}function jn(n,e){var t=We;t!==null&&(t.f&sn)!==0&&(n|=sn);var r={ctx:pt,deps:null,nodes:null,f:n|Wt|kn,first:null,fn:e,last:null,next:null,parent:t,b:t&&t.b,prev:null,teardown:null,wv:0,ac:null};Ue?.register_created_effect(r);var i=r;if((n&Qi)!==0)Ri!==null?Ri.push(r):br.ensure().schedule(r);else if(e!==null){try{no(r)}catch(s){throw Gt(r),s}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&(i.f&fo)===0&&(i=i.first,(n&Fn)!==0&&(n&_r)!==0&&i!==null&&(i.f|=_r))}if(i!==null&&(i.parent=t,t!==null&&o_(i,t),Qe!==null&&(Qe.f&Zt)!==0&&(n&Lr)===0)){var o=Qe;(o.effects??=[]).push(i)}return r}function Hu(){return Qe!==null&&!Ln}function ns(n){const e=jn(es,null);return Et(e,Lt),e.teardown=n,e}function nt(n){Zg();var e=We.f,t=!Qe&&(e&zn)!==0&&(e&vi)===0;if(t){var r=pt;(r.e??=[]).push(n)}else return Xg(n)}function Xg(n){return jn(Qi|bg,n)}function s_(n){return Zg(),jn(es|bg,n)}function a_(n){br.ensure();const e=jn(Lr|fo,n);return(t={})=>new Promise(r=>{t.outro?Qr(e,()=>{Gt(e),r(void 0)}):(Gt(e),r(void 0))})}function Ta(n){return jn(Qi,n)}function l_(n){return jn(Ui|fo,n)}function Na(n,e=0){return jn(es|e,n)}function G(n,e=[],t=[],r=[]){Bg(r,e,t,i=>{jn(es,()=>n(...i.map(l)))})}function mi(n,e=0){var t=jn(Fn|e,n);return t}function Qg(n,e=0){var t=jn(Du|e,n);return t}function ln(n){return jn(zn|fo,n)}function $g(n){var e=n.teardown;if(e!==null){const t=yr,r=Qe;Gc(!0),Nn(null);try{e.call(null)}finally{Gc(t),Nn(r)}}}function Vu(n,e=!1){var t=n.first;for(n.first=n.last=null;t!==null;){const i=t.ac;i!==null&&Ea(()=>{i.abort(Sa)});var r=t.next;(t.f&Lr)!==0?t.parent=null:Gt(t,e),t=r}}function u_(n){for(var e=n.first;e!==null;){var t=e.next;(e.f&zn)===0&&Gt(e),e=t}}function Gt(n,e=!0){var t=!1;(e||(n.f&am)!==0)&&n.nodes!==null&&n.nodes.end!==null&&(eh(n.nodes.start,n.nodes.end),t=!0),Et(n,Ll),Vu(n,e&&!t),Wo(n,0);var r=n.nodes&&n.nodes.t;if(r!==null)for(const o of r)o.stop();$g(n),n.f^=Ll,n.f|=Cn;var i=n.parent;i!==null&&i.first!==null&&th(n),n.next=n.prev=n.teardown=n.ctx=n.deps=n.fn=n.nodes=n.ac=n.b=null}function eh(n,e){for(;n!==null;){var t=n===e?null:ts(n);n.remove(),n=t}}function th(n){var e=n.parent,t=n.prev,r=n.next;t!==null&&(t.next=r),r!==null&&(r.prev=t),e!==null&&(e.first===n&&(e.first=r),e.last===n&&(e.last=t))}function Qr(n,e,t=!0){var r=[];nh(n,r,!0);var i=()=>{t&&Gt(n),e&&e()},o=r.length;if(o>0){var s=()=>--o||i();for(var a of r)a.out(s)}else i()}function nh(n,e,t){if((n.f&sn)===0){n.f^=sn;var r=n.nodes&&n.nodes.t;if(r!==null)for(const a of r)(a.is_global||t)&&e.push(a);for(var i=n.first;i!==null;){var o=i.next;if((i.f&Lr)===0){var s=(i.f&_r)!==0||(i.f&zn)!==0&&(n.f&Fn)!==0;nh(i,e,s?t:!1)}i=o}}}function Ju(n){rh(n,!0)}function rh(n,e){if((n.f&sn)!==0){n.f^=sn,(n.f&Lt)===0&&(Et(n,Wt),br.ensure().schedule(n));for(var t=n.first;t!==null;){var r=t.next,i=(t.f&_r)!==0||(t.f&zn)!==0;rh(t,i?e:!1),t=r}var o=n.nodes&&n.nodes.t;if(o!==null)for(const s of o)(s.is_global||e)&&s.in()}}function qu(n,e){if(n.nodes)for(var t=n.nodes.start,r=n.nodes.end;t!==null;){var i=t===r?null:ts(t);e.append(t),t=i}}let Ws=!1,yr=!1;function Gc(n){yr=n}let Qe=null,Ln=!1;function Nn(n){Qe=n}let We=null;function An(n){We=n}let En=null;function ih(n){Qe!==null&&(En===null?En=[n]:En.push(n))}let an=null,hn=0,yn=null;function c_(n){yn=n}let oh=1,Zr=0,$r=Zr;function Yc(n){$r=n}function sh(){return++oh}function rs(n){var e=n.f;if((e&Wt)!==0)return!0;if(e&Zt&&(n.f&=~ii),(e&nr)!==0){for(var t=n.deps,r=t.length,i=0;i<r;i++){var o=t[i];if(rs(o)&&Wg(o),o.wv>n.wv)return!0}(e&kn)!==0&&In===null&&Et(n,Lt)}return!1}function ah(n,e,t=!0){var r=n.reactions;if(r!==null&&!(En!==null&&Xi.call(En,n)))for(var i=0;i<r.length;i++){var o=r[i];(o.f&Zt)!==0?ah(o,e,!1):e===o&&(t?Et(o,Wt):(o.f&Lt)!==0&&Et(o,nr),Bu(o))}}function lh(n){var e=an,t=hn,r=yn,i=Qe,o=En,s=pt,a=Ln,u=$r,c=n.f;an=null,hn=0,yn=null,Qe=(c&(zn|Lr))===0?n:null,En=null,$i(n.ctx),Ln=!1,$r=++Zr,n.ac!==null&&(Ea(()=>{n.ac.abort(Sa)}),n.ac=null);try{n.f|=Xs;var d=n.fn,f=d();n.f|=vi;var g=n.deps,p=Ue?.is_fork;if(an!==null){var v;if(p||Wo(n,hn),g!==null&&hn>0)for(g.length=hn+an.length,v=0;v<an.length;v++)g[hn+v]=an[v];else n.deps=g=an;if(Hu()&&(n.f&kn)!==0)for(v=hn;v<g.length;v++)(g[v].reactions??=[]).push(n)}else!p&&g!==null&&hn<g.length&&(Wo(n,hn),g.length=hn);if(ho()&&yn!==null&&!Ln&&g!==null&&(n.f&(Zt|nr|Wt))===0)for(v=0;v<yn.length;v++)ah(yn[v],n);if(i!==null&&i!==n){if(Zr++,i.deps!==null)for(let m=0;m<t;m+=1)i.deps[m].rv=Zr;if(e!==null)for(const m of e)m.rv=Zr;yn!==null&&(r===null?r=yn:r.push(...yn))}return(n.f&Pr)!==0&&(n.f^=Pr),f}catch(m){return Og(m)}finally{n.f^=Xs,an=e,hn=t,yn=r,Qe=i,En=o,$i(s),Ln=a,$r=u}}function d_(n,e){let t=e.reactions;if(t!==null){var r=nm.call(t,n);if(r!==-1){var i=t.length-1;i===0?t=e.reactions=null:(t[r]=t[i],t.pop())}}if(t===null&&(e.f&Zt)!==0&&(an===null||!Xi.call(an,e))){var o=e;(o.f&kn)!==0&&(o.f^=kn,o.f&=~ii),o.v!==At&&Lu(o),Qm(o),Wo(o,0)}}function Wo(n,e){var t=n.deps;if(t!==null)for(var r=e;r<t.length;r++)d_(n,t[r])}function no(n){var e=n.f;if((e&Cn)===0){Et(n,Lt);var t=We,r=Ws;We=n,Ws=!0;try{(e&(Fn|Du))!==0?u_(n):Vu(n),$g(n);var i=lh(n);n.teardown=typeof i=="function"?i:null,n.wv=oh;var o;hg&&Im&&(n.f&Wt)!==0&&n.deps}finally{Ws=r,We=t}}}async function f_(){await Promise.resolve(),Fg()}function l(n){var e=n.f,t=(e&Zt)!==0;if(Qe!==null&&!Ln){var r=We!==null&&(We.f&Cn)!==0;if(!r&&(En===null||!Xi.call(En,n))){var i=Qe.deps;if((Qe.f&Xs)!==0)n.rv<Zr&&(n.rv=Zr,an===null&&i!==null&&i[hn]===n?hn++:an===null?an=[n]:an.push(n));else{(Qe.deps??=[]).push(n);var o=n.reactions;o===null?n.reactions=[Qe]:Xi.call(o,Qe)||o.push(Qe)}}}if(yr&&Xr.has(n))return Xr.get(n);if(t){var s=n;if(yr){var a=s.v;return((s.f&Lt)===0&&s.reactions!==null||ch(s))&&(a=ju(s)),Xr.set(s,a),a}var u=(s.f&kn)===0&&!Ln&&Qe!==null&&(Ws||(Qe.f&kn)!==0),c=(s.f&vi)===0;rs(s)&&(u&&(s.f|=kn),Wg(s)),u&&!c&&(Kg(s),uh(s))}if(In?.has(n))return In.get(n);if((n.f&Pr)!==0)throw n.v;return n.v}function uh(n){if(n.f|=kn,n.deps!==null)for(const e of n.deps)(e.reactions??=[]).push(n),(e.f&Zt)!==0&&(e.f&kn)===0&&(Kg(e),uh(e))}function ch(n){if(n.v===At)return!0;if(n.deps===null)return!1;for(const e of n.deps)if(Xr.has(e)||(e.f&Zt)!==0&&ch(e))return!0;return!1}function Xt(n){var e=Ln;try{return Ln=!0,n()}finally{Ln=e}}function Jr(n){if(!(typeof n!="object"||!n||n instanceof EventTarget)){if(Yn in n)Hl(n);else if(!Array.isArray(n))for(let e in n){const t=n[e];typeof t=="object"&&t&&Yn in t&&Hl(t)}}}function Hl(n,e=new Set){if(typeof n=="object"&&n!==null&&!(n instanceof EventTarget)&&!e.has(n)){e.add(n),n instanceof Date&&n.getTime();for(let r in n)try{Hl(n[r],e)}catch{}const t=Pu(n);if(t!==Object.prototype&&t!==Array.prototype&&t!==Map.prototype&&t!==Set.prototype&&t!==Date.prototype){const r=pg(t);for(let i in r){const o=r[i].get;if(o)try{o.call(n)}catch{}}}}}function g_(n){return n.endsWith("capture")&&n!=="gotpointercapture"&&n!=="lostpointercapture"}const h_=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function v_(n){return h_.includes(n)}const p_={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function m_(n){return n=n.toLowerCase(),p_[n]??n}const __=["touchstart","touchmove"];function b_(n){return __.includes(n)}const Ao=Symbol("events"),dh=new Set,Vl=new Set;function Gu(n,e,t,r={}){function i(o){if(r.capture||Jl.call(e,o),!o.cancelBubble)return Ea(()=>t?.call(this,o))}return n.startsWith("pointer")||n.startsWith("touch")||n==="wheel"?Zn(()=>{e.addEventListener(n,i,r)}):e.addEventListener(n,i,r),i}function ta(n,e,t,r={}){var i=Gu(e,n,t,r);return()=>{n.removeEventListener(e,i,r)}}function Bn(n,e,t,r,i){var o={capture:r,passive:i},s=Gu(n,e,t,o);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&ns(()=>{e.removeEventListener(n,s,o)})}function Z(n,e,t){(e[Ao]??={})[n]=t}function ve(n){for(var e=0;e<n.length;e++)dh.add(n[e]);for(var t of Vl)t(n)}let Zc=null;function Jl(n){var e=this,t=e.ownerDocument,r=n.type,i=n.composedPath?.()||[],o=i[0]||n.target;Zc=n;var s=0,a=Zc===n&&n[Ao];if(a){var u=i.indexOf(a);if(u!==-1&&(e===document||e===window)){n[Ao]=e;return}var c=i.indexOf(e);if(c===-1)return;u<=c&&(s=u)}if(o=i[s]||n.target,o!==e){vg(n,"currentTarget",{configurable:!0,get(){return o||t}});var d=Qe,f=We;Nn(null),An(null);try{for(var g,p=[];o!==null;){var v=o.assignedSlot||o.parentNode||o.host||null;try{var m=o[Ao]?.[r];m!=null&&(!o.disabled||n.target===o)&&m.call(o,n)}catch(h){g?p.push(h):g=h}if(n.cancelBubble||v===e||v===null)break;o=v}if(g){for(let h of p)queueMicrotask(()=>{throw h});throw g}}finally{n[Ao]=e,delete n.currentTarget,Nn(d),An(f)}}}const y_=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:n=>n});function x_(n){return y_?.createHTML(n)??n}function fh(n){var e=Wu("template");return e.innerHTML=x_(n.replaceAll("<!>","<!---->")),e.content}function Rr(n,e){var t=We;t.nodes===null&&(t.nodes={start:n,end:e,a:null,t:null})}function M(n,e){var t=(e&Nm)!==0,r=(e&Am)!==0,i,o=!n.startsWith("<!>");return()=>{i===void 0&&(i=fh(o?n:"<!>"+n),t||(i=Gn(i)));var s=r||Jg?document.importNode(i,!0):i.cloneNode(!0);if(t){var a=Gn(s),u=s.lastChild;Rr(a,u)}else Rr(s,s);return s}}function w_(n,e,t="svg"){var r=!n.startsWith("<!>"),i=`<${t}>${r?n:"<!>"+n}</${t}>`,o;return()=>{if(!o){var s=fh(i),a=Gn(s);o=Gn(a)}var u=o.cloneNode(!0);return Rr(u,u),u}}function vo(n,e){return w_(n,e,"svg")}function xr(n=""){{var e=Xn(n+"");return Rr(e,e),e}}function te(){var n=document.createDocumentFragment(),e=document.createComment(""),t=Xn();return n.append(e,t),Rr(e,t),n}function y(n,e){n!==null&&n.before(e)}function $(n,e){var t=e==null?"":typeof e=="object"?`${e}`:e;t!==(n[Bl]??=n.nodeValue)&&(n[Bl]=t,n.nodeValue=`${t}`)}function gh(n,e){return S_(n,e)}const ks=new Map;function S_(n,{target:e,anchor:t,props:r={},events:i,context:o,intro:s=!0,transformError:a}){t_();var u=void 0,c=a_(()=>{var d=t??e.appendChild(Xn());Gm(d,{pending:()=>{}},p=>{ce({});var v=pt;o&&(v.c=o),i&&(r.$$events=i),u=n(p,r)||{},de()},a);var f=new Set,g=p=>{for(var v=0;v<p.length;v++){var m=p[v];if(!f.has(m)){f.add(m);var h=b_(m);for(const S of[e,document]){var x=ks.get(S);x===void 0&&(x=new Map,ks.set(S,x));var _=x.get(m);_===void 0?(S.addEventListener(m,Jl,{passive:h}),x.set(m,1)):x.set(m,_+1)}}}};return g(wa(dh)),Vl.add(g),()=>{for(var p of f)for(const h of[e,document]){var v=ks.get(h),m=v.get(p);--m==0?(h.removeEventListener(p,Jl),v.delete(p),v.size===0&&ks.delete(h)):v.set(p,m)}Vl.delete(g),d!==t&&d.parentNode?.removeChild(d)}});return k_.set(u,c),u}let k_=new WeakMap;class is{anchor;#e=new Map;#n=new Map;#t=new Map;#l=new Set;#r=!0;constructor(e,t=!0){this.anchor=e,this.#r=t}#o=e=>{if(this.#e.has(e)){var t=this.#e.get(e),r=this.#n.get(t);if(r)Ju(r),this.#l.delete(t);else{var i=this.#t.get(t);i&&(this.#n.set(t,i.effect),this.#t.delete(t),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),r=i.effect)}for(const[o,s]of this.#e){if(this.#e.delete(o),o===e)break;const a=this.#t.get(s);a&&(Gt(a.effect),this.#t.delete(s))}for(const[o,s]of this.#n){if(o===t||this.#l.has(o))continue;const a=()=>{if(Array.from(this.#e.values()).includes(o)){var c=document.createDocumentFragment();qu(s,c),c.append(Xn()),this.#t.set(o,{effect:s,fragment:c})}else Gt(s);this.#l.delete(o),this.#n.delete(o)};this.#r||!r?(this.#l.add(o),Qr(s,a,!1)):a()}}};#i=e=>{this.#e.delete(e);const t=Array.from(this.#e.values());for(const[r,i]of this.#t)t.includes(r)||(Gt(i.effect),this.#t.delete(r))};ensure(e,t){var r=Ue,i=Yg();if(t&&!this.#n.has(e)&&!this.#t.has(e))if(i){var o=document.createDocumentFragment(),s=Xn();o.append(s),this.#t.set(e,{effect:ln(()=>t(s)),fragment:o})}else this.#n.set(e,ln(()=>t(this.anchor)));if(this.#e.set(r,e),i){for(const[a,u]of this.#n)a===e?r.unskip_effect(u):r.skip_effect(u);for(const[a,u]of this.#t)a===e?r.unskip_effect(u.effect):r.skip_effect(u.effect);r.oncommit(this.#o),r.ondiscard(this.#i)}else this.#o(r)}}const C_=0,Xc=1,E_=2;function T_(n,e,t,r,i){var o=ho(),s=At,a=o?rr(s):$s(s,!1,!1),u=o?rr(s):$s(s,!1,!1),c=new is(n);mi(()=>{var d=Ue;d.deactivate();var f=e();d.activate();var g=!1;if(om(f)){var p=Ug(),v=!1;const m=h=>{if(!g){v=!0,p(!1),br.ensure();try{h()}finally{Uo(!1),Ki||Fg()}}};f.then(h=>{m(()=>{pr(a,h),c.ensure(Xc,r&&(x=>r(x,a)))})},h=>{m(()=>{if(pr(u,h),c.ensure(E_,i&&(x=>i(x,u))),!i)throw u.v})}),Zn(()=>{v||m(()=>{c.ensure(C_,t)})})}else pr(a,f),c.ensure(Xc,r&&(m=>r(m,a)));return()=>{g=!0}})}function W(n,e,t=!1){var r=new is(n),i=t?_r:0;function o(s,a){r.ensure(s,a)}mi(()=>{var s=!1;e((a,u=0)=>{s=!0,o(u,a)}),s||o(-1,null)},i)}function gt(n,e){return e}function N_(n,e,t){for(var r=[],i=e.length,o,s=e.length,a=0;a<i;a++){let f=e[a];Qr(f,()=>{if(o){if(o.pending.delete(f),o.done.add(f),o.pending.size===0){var g=n.outrogroups;ql(n,wa(o.done)),g.delete(o),g.size===0&&(n.outrogroups=null)}}else s-=1},!1)}if(s===0){var u=r.length===0&&t!==null;if(u){var c=t,d=c.parentNode;n_(d),d.append(c),n.items.clear()}ql(n,e,!u)}else o={pending:new Set(e),done:new Set},(n.outrogroups??=new Set).add(o)}function ql(n,e,t=!0){var r;if(n.pending.size>0){r=new Set;for(const s of n.pending.values())for(const a of s)r.add(n.items.get(a).e)}for(var i=0;i<e.length;i++){var o=e[i];if(r?.has(o)){o.f|=qn;const s=document.createDocumentFragment();qu(o,s)}else Gt(e[i],t)}}var Qc;function Re(n,e,t,r,i,o=null){var s=n,a=new Map,u=(e&wg)!==0;if(u){var c=n;s=c.appendChild(Xn())}var d=null,f=Uu(()=>{var S=t();return Mu(S)?S:S==null?[]:wa(S)}),g,p=new Map,v=!0;function m(S){(_.effect.f&Cn)===0&&(_.pending.delete(S),_.fallback=d,A_(_,g,s,e,r),d!==null&&(g.length===0?(d.f&qn)===0?Ju(d):(d.f^=qn,Oo(d,null,s)):Qr(d,()=>{d=null})))}function h(S){_.pending.delete(S)}var x=mi(()=>{g=l(f);for(var S=g.length,k=new Set,b=Ue,C=Yg(),T=0;T<S;T+=1){var O=g[T],E=r(O,T),D=v?null:a.get(E);D?(D.v&&pr(D.v,O),D.i&&pr(D.i,T),C&&b.unskip_effect(D.e)):(D=O_(a,v?s:Qc??=Xn(),O,E,T,i,e,t),v||(D.e.f|=qn),a.set(E,D)),k.add(E)}if(S===0&&o&&!d&&(v?d=ln(()=>o(s)):(d=ln(()=>o(Qc??=Xn())),d.f|=qn)),S>k.size&&cm(),!v)if(p.set(b,k),C){for(const[L,V]of a)k.has(L)||b.skip_effect(V.e);b.oncommit(m),b.ondiscard(h)}else m(b);l(f)}),_={effect:x,items:a,pending:p,outrogroups:null,fallback:d};v=!1}function ko(n){for(;n!==null&&(n.f&zn)===0;)n=n.next;return n}function A_(n,e,t,r,i){var o=(r&wm)!==0,s=e.length,a=n.items,u=ko(n.effect.first),c,d=null,f,g=[],p=[],v,m,h,x;if(o)for(x=0;x<s;x+=1)v=e[x],m=i(v,x),h=a.get(m).e,(h.f&qn)===0&&(h.nodes?.a?.measure(),(f??=new Set).add(h));for(x=0;x<s;x+=1){if(v=e[x],m=i(v,x),h=a.get(m).e,n.outrogroups!==null)for(const D of n.outrogroups)D.pending.delete(h),D.done.delete(h);if((h.f&sn)!==0&&(Ju(h),o&&(h.nodes?.a?.unfix(),(f??=new Set).delete(h))),(h.f&qn)!==0)if(h.f^=qn,h===u)Oo(h,null,t);else{var _=d?d.next:u;h===n.effect.last&&(n.effect.last=h.prev),h.prev&&(h.prev.next=h.next),h.next&&(h.next.prev=h.prev),Er(n,d,h),Er(n,h,_),Oo(h,_,t),d=h,g=[],p=[],u=ko(d.next);continue}if(h!==u){if(c!==void 0&&c.has(h)){if(g.length<p.length){var S=p[0],k;d=S.prev;var b=g[0],C=g[g.length-1];for(k=0;k<g.length;k+=1)Oo(g[k],S,t);for(k=0;k<p.length;k+=1)c.delete(p[k]);Er(n,b.prev,C.next),Er(n,d,b),Er(n,C,S),u=S,d=C,x-=1,g=[],p=[]}else c.delete(h),Oo(h,u,t),Er(n,h.prev,h.next),Er(n,h,d===null?n.effect.first:d.next),Er(n,d,h),d=h;continue}for(g=[],p=[];u!==null&&u!==h;)(c??=new Set).add(u),p.push(u),u=ko(u.next);if(u===null)continue}(h.f&qn)===0&&g.push(h),d=h,u=ko(h.next)}if(n.outrogroups!==null){for(const D of n.outrogroups)D.pending.size===0&&(ql(n,wa(D.done)),n.outrogroups?.delete(D));n.outrogroups.size===0&&(n.outrogroups=null)}if(u!==null||c!==void 0){var T=[];if(c!==void 0)for(h of c)(h.f&sn)===0&&T.push(h);for(;u!==null;)(u.f&sn)===0&&u!==n.fallback&&T.push(u),u=ko(u.next);var O=T.length;if(O>0){var E=(r&wg)!==0&&s===0?t:null;if(o){for(x=0;x<O;x+=1)T[x].nodes?.a?.measure();for(x=0;x<O;x+=1)T[x].nodes?.a?.fix()}N_(n,T,E)}}o&&Zn(()=>{if(f!==void 0)for(h of f)h.nodes?.a?.apply()})}function O_(n,e,t,r,i,o,s,a){var u=(s&ym)!==0?(s&Sm)===0?$s(t,!1,!1):rr(t):null,c=(s&xm)!==0?rr(i):null;return{v:u,i:c,e:ln(()=>(o(e,u??t,c??i,a),()=>{n.delete(r)}))}}function Oo(n,e,t){if(n.nodes)for(var r=n.nodes.start,i=n.nodes.end,o=e&&(e.f&qn)===0?e.nodes.start:t;r!==null;){var s=ts(r);if(o.before(r),r===i)return;r=s}}function Er(n,e,t){e===null?n.effect.first=t:e.next=t,t===null?n.effect.last=e:t.prev=e}function Gl(n,e,t=!1,r=!1,i=!1,o=!1){var s=n,a="";if(t)var u=n;G(()=>{var c=We;if(a!==(a=e()??"")){if(t){c.nodes=null,u.innerHTML=a,a!==""&&Rr(Gn(u),u.lastChild);return}if(c.nodes!==null&&(eh(c.nodes.start,c.nodes.end),c.nodes=null),a!==""){var d=r?Cg:i?Om:void 0,f=Wu(r?"svg":i?"math":"template",d);f.innerHTML=a;var g=r||i?f:f.content;if(Rr(Gn(g),g.lastChild),r||i)for(;Gn(g);)s.before(Gn(g));else s.before(g)}}})}function ke(n,e,t,r,i){var o=e.$$slots?.[t],s=!1;o===!0&&(o=e.children,s=!0),o===void 0||o(n,s?()=>r:r)}function Dt(n,e,...t){var r=new is(n);mi(()=>{const i=e()??null;r.ensure(i,i&&(o=>i(o,...t)))},_r)}function Vt(n,e,t){var r=new is(n);mi(()=>{var i=e()??null;r.ensure(i,i&&(o=>t(o,i)))},_r)}function M_(n,e,t,r,i,o){var s=null,a=n,u=new is(a,!1);mi(()=>{const c=e()||null;var d=Cg;if(c===null){u.ensure(null,null);return}return u.ensure(c,f=>{if(c){if(s=Wu(c,d),Rr(s,s),r){var g=s.appendChild(Xn());r(s,g)}We.nodes.end=s,f.before(s)}}),()=>{}},_r),ns(()=>{})}function P_(n,e){var t=void 0,r;Qg(()=>{t!==(t=e())&&(r&&(Gt(r),r=null),t&&(r=ln(()=>{Ta(()=>t(n))})))})}function hh(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;e<i;e++)n[e]&&(t=hh(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function D_(){for(var n,e,t=0,r="",i=arguments.length;t<i;t++)(n=arguments[t])&&(e=hh(n))&&(r&&(r+=" "),r+=e);return r}function _t(n){return typeof n=="object"?D_(n):n??""}const $c=[...`
|
|
2
|
-
\r\f \v\uFEFF`];function F_(n,e,t){var r=n==null?"":""+n;if(e&&(r=r?r+" "+e:e),t){for(var i of Object.keys(t))if(t[i])r=r?r+" "+i:i;else if(r.length)for(var o=i.length,s=0;(s=r.indexOf(i,s))>=0;){var a=s+o;(s===0||$c.includes(r[s-1]))&&(a===r.length||$c.includes(r[a]))?r=(s===0?"":r.substring(0,s))+r.substring(a+1):s=a}}return r===""?null:r}function ed(n,e=!1){var t=e?" !important;":";",r="";for(var i of Object.keys(n)){var o=n[i];o!=null&&o!==""&&(r+=" "+i+": "+o+t)}return r}function rl(n){return n[0]!=="-"||n[1]!=="-"?n.toLowerCase():n}function I_(n,e){if(e){var t="",r,i;if(Array.isArray(e)?(r=e[0],i=e[1]):r=e,n){n=String(n).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var o=!1,s=0,a=!1,u=[];r&&u.push(...Object.keys(r).map(rl)),i&&u.push(...Object.keys(i).map(rl));var c=0,d=-1;const m=n.length;for(var f=0;f<m;f++){var g=n[f];if(a?g==="/"&&n[f-1]==="*"&&(a=!1):o?o===g&&(o=!1):g==="/"&&n[f+1]==="*"?a=!0:g==='"'||g==="'"?o=g:g==="("?s++:g===")"&&s--,!a&&o===!1&&s===0){if(g===":"&&d===-1)d=f;else if(g===";"||f===m-1){if(d!==-1){var p=rl(n.substring(c,d).trim());if(!u.includes(p)){g!==";"&&f++;var v=n.substring(c,f).trim();t+=" "+v+";"}}c=f+1,d=-1}}}}return r&&(t+=ed(r)),i&&(t+=ed(i,!0)),t=t.trim(),t===""?null:t}return n==null?null:String(n)}function be(n,e,t,r,i,o){var s=n[Rl];if(s!==t||s===void 0){var a=F_(t,r,o);a==null?n.removeAttribute("class"):e?n.className=a:n.setAttribute("class",a),n[Rl]=t}else if(o&&i!==o)for(var u in o){var c=!!o[u];(i==null||c!==!!i[u])&&n.classList.toggle(u,c)}return o}function il(n,e={},t,r){for(var i in t){var o=t[i];e[i]!==o&&(t[i]==null?n.style.removeProperty(i):n.style.setProperty(i,o,r))}}function Qn(n,e,t,r){var i=n[zl];if(i!==e){var o=I_(e,r);o==null?n.removeAttribute("style"):n.style.cssText=o,n[zl]=e}else r&&(Array.isArray(r)?(il(n,t?.[0],r[0]),il(n,t?.[1],r[1],"important")):il(n,t,r));return r}function Ko(n,e,t=!1){if(n.multiple){if(e==null)return;if(!Mu(e))return Dm();for(var r of n.options)r.selected=e.includes(Fo(r));return}for(r of n.options){var i=Fo(r);if(e_(i,e)){r.selected=!0;return}}(!t||e!==void 0)&&(n.selectedIndex=-1)}function Yu(n){var e=new MutationObserver(()=>{Ko(n,n.__value)});e.observe(n,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),ns(()=>{e.disconnect()})}function vh(n,e,t=e){var r=new WeakSet,i=!0;Ku(n,"change",o=>{var s=o?"[selected]":":checked",a;if(n.multiple)a=[].map.call(n.querySelectorAll(s),Fo);else{var u=n.querySelector(s)??n.querySelector("option:not([disabled])");a=u&&Fo(u)}t(a),n.__value=a,Ue!==null&&r.add(Ue)}),Ta(()=>{var o=e();if(n===document.activeElement){var s=Ue;if(r.has(s))return}if(Ko(n,o,i),i&&o===void 0){var a=n.querySelector(":checked");a!==null&&(o=Fo(a),t(o))}n.__value=o,i=!1}),Yu(n)}function Fo(n){return"__value"in n?n.__value:n.value}const Co=Symbol("class"),Pi=Symbol("style"),ph=Symbol("is custom element"),mh=Symbol("is html"),L_=Fu?"option":"OPTION",R_=Fu?"select":"SELECT",z_=Fu?"progress":"PROGRESS";function ir(n,e){var t=Aa(n);t.value===(t.value=e??void 0)||n.value===e&&(e!==0||n.nodeName!==z_)||(n.value=e??"")}function B_(n,e){var t=Aa(n);t.checked!==(t.checked=e??void 0)&&(n.checked=e)}function U_(n,e){e?n.hasAttribute("selected")||n.setAttribute("selected",""):n.removeAttribute("selected")}function re(n,e,t,r){var i=Aa(n);i[e]!==(i[e]=t)&&(e==="loading"&&(n[lm]=t),t==null?n.removeAttribute(e):typeof t!="string"&&_h(n).includes(e)?n[e]=t:n.setAttribute(e,t))}function j_(n,e,t,r,i=!1,o=!1){var s=Aa(n),a=s[ph],u=!s[mh],c=e||{},d=n.nodeName===L_;for(var f in e)f in t||(t[f]=null);t.class?t.class=_t(t.class):(r||t[Co])&&(t.class=null),t[Pi]&&(t.style??=null);var g=_h(n);for(const k in t){let b=t[k];if(d&&k==="value"&&b==null){n.value=n.__value="",c[k]=b;continue}if(k==="class"){var p=n.namespaceURI==="http://www.w3.org/1999/xhtml";be(n,p,b,r,e?.[Co],t[Co]),c[k]=b,c[Co]=t[Co];continue}if(k==="style"){Qn(n,b,e?.[Pi],t[Pi]),c[k]=b,c[Pi]=t[Pi];continue}var v=c[k];if(!(b===v&&!(b===void 0&&n.hasAttribute(k)))){c[k]=b;var m=k[0]+k[1];if(m!=="$$")if(m==="on"){const C={},T="$$"+k;let O=k.slice(2);var h=v_(O);if(g_(O)&&(O=O.slice(0,-7),C.capture=!0),!h&&v){if(b!=null)continue;n.removeEventListener(O,c[T],C),c[T]=null}if(h)Z(O,n,b),ve([O]);else if(b!=null){let E=function(D){c[k].call(this,D)};var S=E;c[T]=Gu(O,n,E,C)}}else if(k==="style")re(n,k,b);else if(k==="autofocus")r_(n,!!b);else if(!a&&(k==="__value"||k==="value"&&b!=null))n.value=n.__value=b;else if(k==="selected"&&d)U_(n,b);else{var x=k;u||(x=m_(x));var _=x==="defaultValue"||x==="defaultChecked";if(b==null&&!a&&!_)if(s[k]=null,x==="value"||x==="checked"){let C=n;const T=e===void 0;if(x==="value"){let O=C.defaultValue;C.removeAttribute(x),C.defaultValue=O,C.value=C.__value=T?O:null}else{let O=C.defaultChecked;C.removeAttribute(x),C.defaultChecked=O,C.checked=T?O:!1}}else n.removeAttribute(k);else _||g.includes(x)&&(a||typeof b!="string")?(n[x]=b,x in s&&(s[x]=At)):typeof b!="function"&&re(n,x,b)}}}return c}function Yl(n,e,t=[],r=[],i=[],o,s=!1,a=!1){Bg(i,t,r,u=>{var c=void 0,d={},f=n.nodeName===R_,g=!1;if(Qg(()=>{var v=e(...u.map(l)),m=j_(n,c,v,o,s,a);g&&f&&"value"in v&&Ko(n,v.value);for(let x of Object.getOwnPropertySymbols(d))v[x]||Gt(d[x]);for(let x of Object.getOwnPropertySymbols(v)){var h=v[x];x.description===Mm&&(!c||h!==c[x])&&(d[x]&&Gt(d[x]),d[x]=ln(()=>P_(n,()=>h))),m[x]=h}c=m}),f){var p=n;Ta(()=>{Ko(p,c.value,!0),Yu(p)})}g=!0})}function Aa(n){return n[xg]??={[ph]:n.nodeName.includes("-"),[mh]:n.namespaceURI===kg}}var td=new Map;function _h(n){var e=n.getAttribute("is")||n.nodeName,t=td.get(e);if(t)return t;td.set(e,t=[]);for(var r,i=n,o=Element.prototype;o!==i;){r=pg(i);for(var s in r)r[s].set&&s!=="innerHTML"&&s!=="textContent"&&s!=="innerText"&&t.push(s);i=Pu(i)}return t}function zt(n,e,t=e){var r=new WeakSet;Ku(n,"input",async i=>{var o=i?n.defaultValue:n.value;if(o=ol(n)?sl(o):o,t(o),Ue!==null&&r.add(Ue),await f_(),o!==(o=e())){var s=n.selectionStart,a=n.selectionEnd,u=n.value.length;if(n.value=o??"",a!==null){var c=n.value.length;s===a&&a===u&&c>u?(n.selectionStart=c,n.selectionEnd=c):(n.selectionStart=s,n.selectionEnd=Math.min(a,c))}}}),Xt(e)==null&&n.value&&(t(ol(n)?sl(n.value):n.value),Ue!==null&&r.add(Ue)),Na(()=>{var i=e();if(n===document.activeElement){var o=Ue;if(r.has(o))return}ol(n)&&i===sl(n.value)||n.type==="date"&&!i&&!n.value||i!==n.value&&(n.value=i??"")})}function Zu(n,e,t=e){Ku(n,"change",r=>{var i=r?n.defaultChecked:n.checked;t(i)}),Xt(e)==null&&t(n.checked),Na(()=>{var r=e();n.checked=!!r})}function ol(n){var e=n.type;return e==="number"||e==="range"}function sl(n){return n===""?null:+n}function al(n,e){return n===e||n?.[Yn]===e}function _n(n={},e,t,r){var i=pt.r,o=We;return Ta(()=>{var s,a;return Na(()=>{s=a,a=[],Xt(()=>{al(t(...a),n)||(e(n,...a),s&&al(t(...s),n)&&e(null,...s))})}),()=>{let u=o;for(;u!==i&&u.parent!==null&&u.parent.f⋘)u=u.parent;const c=()=>{a&&al(t(...a),n)&&e(null,...a)},d=u.teardown;u.teardown=()=>{c(),d?.()}}}),n}function os(n=!1){const e=pt,t=e.l.u;if(!t)return;let r=()=>Jr(e.s);if(n){let i=0,o={};const s=to(()=>{let a=!1;const u=e.s;for(const c in u)u[c]!==o[c]&&(o[c]=u[c],a=!0);return a&&i++,i});r=()=>l(s)}t.b.length&&s_(()=>{nd(e,r),Fl(t.b)}),nt(()=>{const i=Xt(()=>t.m.map(sm));return()=>{for(const o of i)typeof o=="function"&&o()}}),t.a.length&&nt(()=>{nd(e,r),Fl(t.a)})}function nd(n,e){if(n.l.s)for(const t of n.l.s)l(t);e()}const W_={get(n,e){if(!n.exclude.includes(e))return n.props[e]},set(n,e){return!1},getOwnPropertyDescriptor(n,e){if(!n.exclude.includes(e)&&e in n.props)return{enumerable:!0,configurable:!0,value:n.props[e]}},has(n,e){return n.exclude.includes(e)?!1:e in n.props},ownKeys(n){return Reflect.ownKeys(n.props).filter(e=>!n.exclude.includes(e))}};function bh(n,e,t){return new Proxy({props:n,exclude:e},W_)}const K_={get(n,e){if(!n.exclude.includes(e))return l(n.version),e in n.special?n.special[e]():n.props[e]},set(n,e,t){if(!(e in n.special)){var r=We;try{An(n.parent_effect),n.special[e]=se({get[e](){return n.props[e]}},e,Sg)}finally{An(r)}}return n.special[e](t),ea(n.version),!0},getOwnPropertyDescriptor(n,e){if(!n.exclude.includes(e)&&e in n.props)return{enumerable:!0,configurable:!0,value:n.props[e]}},deleteProperty(n,e){return n.exclude.includes(e)||(n.exclude.push(e),ea(n.version)),!0},has(n,e){return n.exclude.includes(e)?!1:e in n.props},ownKeys(n){return Reflect.ownKeys(n.props).filter(e=>!n.exclude.includes(e))}};function Se(n,e){return new Proxy({props:n,exclude:e,special:{},version:rr(0),parent_effect:We},K_)}const H_={get(n,e){let t=n.props.length;for(;t--;){let r=n.props[t];if(So(r)&&(r=r()),typeof r=="object"&&r!==null&&e in r)return r[e]}},set(n,e,t){let r=n.props.length;for(;r--;){let i=n.props[r];So(i)&&(i=i());const o=Mr(i,e);if(o&&o.set)return o.set(t),!0}return!1},getOwnPropertyDescriptor(n,e){let t=n.props.length;for(;t--;){let r=n.props[t];if(So(r)&&(r=r()),typeof r=="object"&&r!==null&&e in r){const i=Mr(r,e);return i&&!i.configurable&&(i.configurable=!0),i}}},has(n,e){if(e===Yn||e===yg)return!1;for(let t of n.props)if(So(t)&&(t=t()),t!=null&&e in t)return!0;return!1},ownKeys(n){const e=[];for(let t of n.props)if(So(t)&&(t=t()),!!t){for(const r in t)e.includes(r)||e.push(r);for(const r of Object.getOwnPropertySymbols(t))e.includes(r)||e.push(r)}return e}};function xe(...n){return new Proxy({props:n},H_)}function se(n,e,t,r){var i=!go||(t&Cm)!==0,o=(t&Em)!==0,s=(t&Tm)!==0,a=r,u=!0,c=void 0,d=()=>s&&i?(c??=to(r),l(c)):(u&&(u=!1,a=s?Xt(r):r),a);let f;if(o){var g=Yn in n||yg in n;f=Mr(n,e)?.set??(g&&e in n?k=>n[e]=k:void 0)}var p,v=!1;o?[p,v]=Hm(()=>n[e]):p=n[e],p===void 0&&r!==void 0&&(p=d(),f&&(i&&vm(),f(p)));var m;if(i?m=()=>{var k=n[e];return k===void 0?d():(u=!0,k)}:m=()=>{var k=n[e];return k!==void 0&&(a=void 0),k===void 0?a:k},i&&(t&Sg)===0)return m;if(f){var h=n.$$legacy;return(function(k,b){return arguments.length>0?((!i||!b||h||v)&&f(b?m():k),k):m()})}var x=!1,_=((t&km)!==0?to:Uu)(()=>(x=!1,m()));o&&l(_);var S=We;return(function(k,b){if(arguments.length>0){const C=b?l(_):i&&o?Be(k):k;return A(_,C),x=!0,a!==void 0&&(a=C),k}return yr&&x||(S.f&Cn)!==0?_.v:l(_)})}function ht(n){pt===null&&Iu(),go&&pt.l!==null?J_(pt).m.push(n):nt(()=>{const e=Xt(n);if(typeof e=="function")return e})}function V_(n){pt===null&&Iu(),ht(()=>()=>Xt(n))}function J_(n){var e=n.l;return e.u??={a:[],b:[],m:[]}}const q_="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(q_);const G_=Array(12).fill(0);var Y_=M('<div class="sonner-loading-bar"></div>'),Z_=M('<div><div class="sonner-spinner"></div></div>');function X_(n,e){ce(e,!0);var t=Z_(),r=w(t);Re(r,23,()=>G_,(i,o)=>`spinner-bar-${o}`,(i,o)=>{var s=Y_();y(i,s)}),G(i=>{be(t,1,i),re(t,"data-visible",e.visible)},[()=>_t(["sonner-loading-wrapper",e.class].filter(Boolean).join(" "))]),y(n,t),de()}function Hn(...n){return n.filter(Boolean).join(" ")}const Q_=typeof document<"u",$_=typeof window<"u"?window:void 0;function eb(n){let e=n.activeElement;for(;e?.shadowRoot;){const t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e}class tb{#e;#n;constructor(e={}){const{window:t=$_,document:r=t?.document}=e;t!==void 0&&(this.#e=r,this.#n=zg(i=>{const o=ta(t,"focusin",i),s=ta(t,"focusout",i);return()=>{o(),s()}}))}get current(){return this.#n?.(),this.#e?eb(this.#e):null}}new tb;class nb{#e;#n;constructor(e){this.#e=e,this.#n=Symbol(e)}get key(){return this.#n}exists(){return Rm(this.#n)}get(){const e=eo(this.#n);if(e===void 0)throw new Error(`Context "${this.#e}" not found`);return e}getOr(e){const t=eo(this.#n);return t===void 0?e:t}set(e){return pi(this.#n,e)}}const rb=new nb("<Toaster/>");let rd=0;class ib{#e=X(Be([]));get toasts(){return l(this.#e)}set toasts(e){A(this.#e,e,!0)}#n=X(Be([]));get heights(){return l(this.#n)}set heights(e){A(this.#n,e,!0)}#t=e=>{const t=this.toasts.findIndex(r=>r.id===e);return t===-1?null:t};addToast=e=>{Q_&&this.toasts.unshift(e)};updateToast=({id:e,data:t,type:r,message:i})=>{const o=this.toasts.findIndex(a=>a.id===e),s=this.toasts[o];this.toasts[o]={...s,...t,id:e,title:i,type:r,updated:!0}};create=e=>{const{message:t,...r}=e,i=typeof e?.id=="number"||e.id&&e.id?.length>0?e.id:rd++,o=e.dismissible!==void 0?e.dismissible:e.dismissable!==void 0?e.dismissable:!0,s=e.type===void 0?"default":e.type;return Xt(()=>{this.toasts.find(u=>u.id===i)?this.updateToast({id:i,data:e,type:s,message:t,dismissible:o}):this.addToast({...r,id:i,title:t,dismissible:o,type:s})}),i};dismiss=e=>(Xt(()=>{if(e===void 0){this.toasts=this.toasts.map(r=>({...r,dismiss:!0}));return}const t=this.toasts.findIndex(r=>r.id===e);this.toasts[t]&&(this.toasts[t]={...this.toasts[t],dismiss:!0})}),e);remove=e=>{if(e===void 0){this.toasts=[];return}const t=this.#t(e);if(t!==null)return this.toasts.splice(t,1),e};message=(e,t)=>this.create({...t,type:"default",message:e});error=(e,t)=>this.create({...t,type:"error",message:e});success=(e,t)=>this.create({...t,type:"success",message:e});info=(e,t)=>this.create({...t,type:"info",message:e});warning=(e,t)=>this.create({...t,type:"warning",message:e});loading=(e,t)=>this.create({...t,type:"loading",message:e});promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:typeof t.loading=="string"?t.loading:t.loading()}));const i=e instanceof Promise?e:e();let o=r!==void 0;return i.then(s=>{if(typeof s=="object"&&s&&"ok"in s&&typeof s.ok=="boolean"&&!s.ok){o=!1;const a=ob(s);this.create({id:r,type:"error",message:a})}else if(t.success!==void 0){o=!1;const a=typeof t.success=="function"?t.success(s):t.success;this.create({id:r,type:"success",message:a})}}).catch(s=>{if(t.error!==void 0){o=!1;const a=typeof t.error=="function"?t.error(s):t.error;this.create({id:r,type:"error",message:a})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),t.finally?.()}),r};custom=(e,t)=>{const r=t?.id||rd++;return this.create({component:e,id:r,...t}),r};removeHeight=e=>{this.heights=this.heights.filter(t=>t.toastId!==e)};setHeight=e=>{const t=this.#t(e.toastId);if(t===null){this.heights.push(e);return}this.heights[t]=e};reset=()=>{this.toasts=[],this.heights=[]}}function ob(n){return n&&typeof n=="object"&&"status"in n?`HTTP error! Status: ${n.status}`:`Error! ${n}`}const at=new ib;function sb(n,e){return at.create({message:n,...e})}class ab{#e=U(()=>at.toasts.filter(e=>!e.dismiss));get toasts(){return l(this.#e)}}const lb=sb,ze=Object.assign(lb,{success:at.success,info:at.info,warning:at.warning,error:at.error,custom:at.custom,message:at.message,promise:at.promise,dismiss:at.dismiss,loading:at.loading,getActiveToasts:()=>at.toasts.filter(n=>!n.dismiss)});function Cs(n){return n.label!==void 0}function ub(){let n=X(Be(typeof document<"u"?document.hidden:!1));return nt(()=>ta(document,"visibilitychange",()=>{A(n,document.hidden,!0)})),{get current(){return l(n)}}}const id=4e3,cb=14,db=45,fb=200,gb=.05,hb={toast:"",title:"",description:"",loader:"",closeButton:"",cancelButton:"",actionButton:"",action:"",warning:"",error:"",success:"",default:"",info:"",loading:""};function vb(n){const[e,t]=n.split("-"),r=[];return e&&r.push(e),t&&r.push(t),r}function od(n){return 1/(1.5+Math.abs(n)/20)}var pb=M("<div><!></div>"),mb=M('<button data-close-button=""><!></button>'),_b=M('<div data-icon=""><!> <!></div>'),bb=M('<div data-description=""><!></div>'),yb=M('<button data-button="" data-cancel=""> </button>'),xb=M('<button data-button=""> </button>'),wb=M('<!> <div data-content=""><div data-title=""><!></div> <!></div> <!> <!>',1),Sb=M('<li aria-atomic="true" data-sonner-toast=""><!> <!></li>');function kb(n,e){ce(e,!0);const t=ye=>{var Ce=te(),Pe=q(Ce);{var Le=je=>{var Me=pb(),wt=w(Me);Dt(wt,()=>e.loadingIcon),G(Pt=>{be(Me,1,Pt),re(Me,"data-visible",l(C)==="loading")},[()=>_t(Hn(l(H)?.loader,e.toast?.classes?.loader,"sonner-loader"))]),y(je,Me)},Ke=je=>{{let Me=U(()=>Hn(l(H)?.loader,e.toast.classes?.loader)),wt=U(()=>l(C)==="loading");X_(je,{get class(){return l(Me)},get visible(){return l(wt)}})}};W(Pe,je=>{e.loadingIcon?je(Le):je(Ke,-1)})}y(ye,Ce)};let r=se(e,"cancelButtonStyle",3,""),i=se(e,"actionButtonStyle",3,""),o=se(e,"descriptionClass",3,""),s=se(e,"unstyled",3,!1),a=se(e,"defaultRichColors",3,!1);const u={...hb};let c=X(!1),d=X(!1),f=X(!1),g=X(!1),p=X(!1),v=X(0),m=X(0),h=e.toast.duration||e.duration||id,x=X(void 0),_=X(null),S=X(null);const k=U(()=>e.index===0),b=U(()=>e.index+1<=e.visibleToasts),C=U(()=>e.toast.type),T=U(()=>e.toast.dismissible!==void 0?e.toast.dismissible!==!1:e.toast.dismissable!==!1),O=U(()=>e.toast.class||""),E=U(()=>e.toast.descriptionClass||""),D=U(()=>at.heights.findIndex(ye=>ye.toastId===e.toast.id)||0),L=U(()=>e.toast.closeButton??e.closeButton),V=U(()=>e.toast.duration??e.duration??id);let J=null;const R=U(()=>e.position.split("-")),P=U(()=>at.heights.reduce((ye,Ce,Pe)=>Pe>=l(D)?ye:ye+Ce.height,0)),K=ub(),Q=U(()=>e.toast.invert||e.invert),ee=U(()=>l(C)==="loading"),H=U(()=>({...u,...e.classes})),j=U(()=>e.toast.title),ne=U(()=>e.toast.description);let B=X(0),z=X(0);const F=U(()=>Math.round(l(D)*cb+l(P)));nt(()=>{l(j),l(ne);let ye;e.expanded||e.expandByDefault?ye=1:ye=1-e.index*gb;const Ce=Xt(()=>l(x));if(Ce===void 0)return;Ce.style.setProperty("height","auto");const Pe=Ce.offsetHeight,Le=Ce.getBoundingClientRect().height,Ke=Math.round(Le/ye+Number.EPSILON&100)/100;Ce.style.removeProperty("height");let je;Math.abs(Ke-Pe)<1?je=Ke:je=Pe,A(m,je,!0),at.setHeight({toastId:e.toast.id,height:je})});function I(){A(d,!0),A(v,l(F),!0),at.removeHeight(e.toast.id),setTimeout(()=>{at.remove(e.toast.id)},fb)}let Y;const ie=U(()=>e.toast.promise&&l(C)==="loading"||e.toast.duration===Number.POSITIVE_INFINITY);function ue(){A(B,new Date().getTime(),!0),Y=setTimeout(()=>{e.toast.onAutoClose?.(e.toast),I()},h)}function we(){if(l(z)<l(B)){const ye=new Date().getTime()-l(B);h=h-ye}A(z,new Date().getTime(),!0)}nt(()=>{e.toast.updated&&(clearTimeout(Y),h=l(V),l(ie)||ue())}),nt(()=>(l(ie)||(e.expanded||e.interacting||e.pauseWhenPageIsHidden&&K.current?we():ue()),()=>clearTimeout(Y))),ht(()=>{A(c,!0);const ye=l(x)?.getBoundingClientRect().height;return A(m,ye,!0),at.setHeight({toastId:e.toast.id,height:ye}),()=>{at.removeHeight(e.toast.id)}}),nt(()=>{e.toast.delete&&Xt(()=>{I(),e.toast.onDismiss?.(e.toast)})});const me=ye=>{if(l(ee))return;A(v,l(F),!0);const Ce=ye.target;Ce.setPointerCapture(ye.pointerId),Ce.tagName!=="BUTTON"&&(A(f,!0),J={x:ye.clientX,y:ye.clientY})},ge=()=>{if(l(g)||!l(T))return;J=null;const ye=Number(l(x)?.style.getPropertyValue("--swipe-amount-x").replace("px","")||0),Ce=Number(l(x)?.style.getPropertyValue("--swipe-amount-y").replace("px","")||0),Pe=new Date().getTime()-0,Le=l(_)==="x"?ye:Ce,Ke=Math.abs(Le)/Pe;if(Math.abs(Le)>=db||Ke>.11){A(v,l(F),!0),e.toast.onDismiss?.(e.toast),l(_)==="x"?A(S,ye>0?"right":"left",!0):A(S,Ce>0?"down":"up",!0),I(),A(g,!0);return}else l(x)?.style.setProperty("--swipe-amount-x","0px"),l(x)?.style.setProperty("--swipe-amount-y","0px");A(p,!1),A(f,!1),A(_,null)},Te=ye=>{if(!J||!l(T)||(window.getSelection()?.toString().length??-1)>0)return;const Pe=ye.clientY-J.y,Le=ye.clientX-J.x,Ke=e.swipeDirections??vb(e.position);!l(_)&&(Math.abs(Le)>1||Math.abs(Pe)>1)&&A(_,Math.abs(Le)>Math.abs(Pe)?"x":"y",!0);let je={x:0,y:0};if(l(_)==="y"){if(Ke.includes("top")||Ke.includes("bottom"))if(Ke.includes("top")&&Pe<0||Ke.includes("bottom")&&Pe>0)je.y=Pe;else{const Me=Pe*od(Pe);je.y=Math.abs(Me)<Math.abs(Pe)?Me:Pe}}else if(l(_)==="x"&&(Ke.includes("left")||Ke.includes("right")))if(Ke.includes("left")&&Le<0||Ke.includes("right")&&Le>0)je.x=Le;else{const Me=Le*od(Le);je.x=Math.abs(Me)<Math.abs(Le)?Me:Le}(Math.abs(je.x)>0||Math.abs(je.y)>0)&&A(p,!0),l(x)?.style.setProperty("--swipe-amount-x",`${je.x}px`),l(x)?.style.setProperty("--swipe-amount-y",`${je.y}px`)},Ne=()=>{A(f,!1),A(_,null),J=null},Oe=U(()=>e.toast.icon?e.toast.icon:l(C)==="success"?e.successIcon:l(C)==="error"?e.errorIcon:l(C)==="warning"?e.warningIcon:l(C)==="info"?e.infoIcon:l(C)==="loading"?e.loadingIcon:null);var he=Sb();re(he,"tabindex",0);let et;var Ye=w(he);{var Ct=ye=>{var Ce=mb(),Pe=w(Ce);Dt(Pe,()=>e.closeIcon??Ot),G(Le=>{re(Ce,"aria-label",e.closeButtonAriaLabel),re(Ce,"data-disabled",l(ee)),be(Ce,1,Le)},[()=>_t(Hn(l(H)?.closeButton,e.toast?.classes?.closeButton))]),Z("click",Ce,()=>{l(ee)||!l(T)||(I(),e.toast.onDismiss?.(e.toast))}),y(ye,Ce)};W(Ye,ye=>{l(L)&&!e.toast.component&&l(C)!=="loading"&&e.closeIcon!==null&&ye(Ct)})}var Tt=N(Ye,2);{var Fe=ye=>{const Ce=U(()=>e.toast.component);var Pe=te(),Le=q(Pe);Vt(Le,()=>l(Ce),(Ke,je)=>{je(Ke,xe(()=>e.toast.componentProps,{closeToast:I}))}),y(ye,Pe)},tt=ye=>{var Ce=wb(),Pe=q(Ce);{var Le=Ie=>{var qe=_b(),De=w(qe);{var ut=Ge=>{var Xe=te(),Kt=q(Xe);{var St=Cr=>{var xs=te(),el=q(xs);Vt(el,()=>e.toast.icon,(Ht,$t)=>{$t(Ht,{})}),y(Cr,xs)},gn=Cr=>{t(Cr)};W(Kt,Cr=>{e.toast.icon?Cr(St):Cr(gn,-1)})}y(Ge,Xe)};W(De,Ge=>{(e.toast.promise||l(C)==="loading")&&Ge(ut)})}var Nt=N(De,2);{var mt=Ge=>{var Xe=te(),Kt=q(Xe);{var St=Ht=>{var $t=te(),ur=q($t);Vt(ur,()=>e.toast.icon,(em,tm)=>{tm(em,{})}),y(Ht,$t)},gn=Ht=>{var $t=te(),ur=q($t);Dt(ur,()=>e.successIcon??Ot),y(Ht,$t)},Cr=Ht=>{var $t=te(),ur=q($t);Dt(ur,()=>e.errorIcon??Ot),y(Ht,$t)},xs=Ht=>{var $t=te(),ur=q($t);Dt(ur,()=>e.warningIcon??Ot),y(Ht,$t)},el=Ht=>{var $t=te(),ur=q($t);Dt(ur,()=>e.infoIcon??Ot),y(Ht,$t)};W(Kt,Ht=>{e.toast.icon?Ht(St):l(C)==="success"?Ht(gn,1):l(C)==="error"?Ht(Cr,2):l(C)==="warning"?Ht(xs,3):l(C)==="info"&&Ht(el,4)})}y(Ge,Xe)};W(Nt,Ge=>{e.toast.type!=="loading"&&Ge(mt)})}G(Ge=>be(qe,1,Ge),[()=>_t(Hn(l(H)?.icon,e.toast?.classes?.icon))]),y(Ie,qe)};W(Pe,Ie=>{(l(C)||e.toast.icon||e.toast.promise)&&e.toast.icon!==null&&(l(Oe)!==null||e.toast.icon)&&Ie(Le)})}var Ke=N(Pe,2),je=w(Ke),Me=w(je);{var wt=Ie=>{var qe=te(),De=q(qe);{var ut=mt=>{const Ge=U(()=>e.toast.title);var Xe=te(),Kt=q(Xe);Vt(Kt,()=>l(Ge),(St,gn)=>{gn(St,xe(()=>e.toast.componentProps))}),y(mt,Xe)},Nt=mt=>{var Ge=xr();G(()=>$(Ge,e.toast.title)),y(mt,Ge)};W(De,mt=>{typeof e.toast.title!="string"?mt(ut):mt(Nt,-1)})}y(Ie,qe)};W(Me,Ie=>{e.toast.title&&Ie(wt)})}var Pt=N(je,2);{var Ve=Ie=>{var qe=bb(),De=w(qe);{var ut=mt=>{const Ge=U(()=>e.toast.description);var Xe=te(),Kt=q(Xe);Vt(Kt,()=>l(Ge),(St,gn)=>{gn(St,xe(()=>e.toast.componentProps))}),y(mt,Xe)},Nt=mt=>{var Ge=xr();G(()=>$(Ge,e.toast.description)),y(mt,Ge)};W(De,mt=>{typeof e.toast.description!="string"?mt(ut):mt(Nt,-1)})}G(mt=>be(qe,1,mt),[()=>_t(Hn(o(),l(E),l(H)?.description,e.toast.classes?.description))]),y(Ie,qe)};W(Pt,Ie=>{e.toast.description&&Ie(Ve)})}var lt=N(Ke,2);{var ot=Ie=>{var qe=te(),De=q(qe);{var ut=Ge=>{var Xe=te(),Kt=q(Xe);Vt(Kt,()=>e.toast.cancel,(St,gn)=>{gn(St,{})}),y(Ge,Xe)},Nt=Ge=>{var Xe=yb(),Kt=w(Xe);G(St=>{Qn(Xe,e.toast.cancelButtonStyle??r()),be(Xe,1,St),$(Kt,e.toast.cancel.label)},[()=>_t(Hn(l(H)?.cancelButton,e.toast?.classes?.cancelButton))]),Z("click",Xe,St=>{Cs(e.toast.cancel)&&l(T)&&(e.toast.cancel?.onClick?.(St),I())}),y(Ge,Xe)},mt=U(()=>Cs(e.toast.cancel));W(De,Ge=>{typeof e.toast.cancel=="function"?Ge(ut):l(mt)&&Ge(Nt,1)})}y(Ie,qe)};W(lt,Ie=>{e.toast.cancel&&Ie(ot)})}var Ze=N(lt,2);{var dt=Ie=>{var qe=te(),De=q(qe);{var ut=Ge=>{var Xe=te(),Kt=q(Xe);Vt(Kt,()=>e.toast.action,(St,gn)=>{gn(St,{})}),y(Ge,Xe)},Nt=Ge=>{var Xe=xb(),Kt=w(Xe);G(St=>{Qn(Xe,e.toast.actionButtonStyle??i()),be(Xe,1,St),$(Kt,e.toast.action.label)},[()=>_t(Hn(l(H)?.actionButton,e.toast?.classes?.actionButton))]),Z("click",Xe,St=>{Cs(e.toast.action)&&(e.toast.action?.onClick(St),!St.defaultPrevented&&I())}),y(Ge,Xe)},mt=U(()=>Cs(e.toast.action));W(De,Ge=>{typeof e.toast.action=="function"?Ge(ut):l(mt)&&Ge(Nt,1)})}y(Ie,qe)};W(Ze,Ie=>{e.toast.action&&Ie(dt)})}G((Ie,qe)=>{be(Ke,1,Ie),be(je,1,qe)},[()=>_t(Hn(l(H)?.content,e.toast?.classes?.content)),()=>_t(Hn(l(H)?.title,e.toast?.classes?.title))]),y(ye,Ce)};W(Tt,ye=>{e.toast.component?ye(Fe):ye(tt,-1)})}_n(he,ye=>A(x,ye),()=>l(x)),G((ye,Ce,Pe)=>{be(he,1,ye),re(he,"aria-live",e.toast.important?"assertive":"polite"),re(he,"data-rich-colors",e.toast.richColors??a()),re(he,"data-styled",!(e.toast.component||e.toast.unstyled||s())),re(he,"data-mounted",l(c)),re(he,"data-promise",Ce),re(he,"data-swiped",l(p)),re(he,"data-removed",l(d)),re(he,"data-visible",l(b)),re(he,"data-y-position",l(R)[0]),re(he,"data-x-position",l(R)[1]),re(he,"data-index",e.index),re(he,"data-front",l(k)),re(he,"data-swiping",l(f)),re(he,"data-dismissible",l(T)),re(he,"data-type",l(C)),re(he,"data-invert",l(Q)),re(he,"data-swipe-out",l(g)),re(he,"data-swipe-direction",l(S)),re(he,"data-expanded",Pe),et=Qn(he,`${e.style} ${e.toast.style}`,et,{"--index":e.index,"--toasts-before":e.index,"--z-index":at.toasts.length-e.index,"--offset":`${l(d)?l(v):l(F)}px`,"--initial-height":e.expandByDefault?"auto":`${l(m)}px`})},[()=>_t(Hn(e.class,l(O),l(H)?.toast,e.toast?.classes?.toast,l(H)?.[l(C)],e.toast?.classes?.[l(C)])),()=>!!e.toast.promise,()=>!!(e.expanded||e.expandByDefault&&l(c))]),Z("pointermove",he,Te),Z("pointerup",he,ge),Z("pointerdown",he,me),Bn("dragend",he,Ne),y(n,he),de()}ve(["pointermove","pointerup","pointerdown","click"]);Lm();var Cb=vo('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-success-icon=""><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>');function Eb(n){var e=Cb();y(n,e)}var Tb=vo('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-error-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>');function Nb(n){var e=Tb();y(n,e)}var Ab=vo('<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" data-sonner-warning-icon="" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>');function Ob(n){var e=Ab();y(n,e)}var Mb=vo('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-info-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>');function Pb(n){var e=Mb();y(n,e)}var Db=vo('<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-sonner-close-icon=""><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>');function Fb(n){var e=Db();y(n,e)}const Ib=3,yh="24px",xh="16px",Lb=4e3,Rb=356,zb=14,ll="dark",Es="light";function Bb(n,e){const t={};return[n,e].forEach((r,i)=>{const o=i===1,s=o?"--mobile-offset":"--offset",a=o?xh:yh;function u(c){["top","right","bottom","left"].forEach(d=>{t[`${s}-${d}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{const d=r[c];d===void 0?t[`${s}-${c}`]=a:t[`${s}-${c}`]=typeof d=="number"?`${d}px`:d}):u(a)}),t}var Ub=M("<ol></ol>"),jb=M('<section aria-live="polite" aria-relevant="additions text" aria-atomic="false" class="svelte-dw134u"><!></section>');function Wb(n,e){ce(e,!0);function t(I){return I!=="system"?I:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?ll:Es}let r=se(e,"invert",3,!1),i=se(e,"position",3,"bottom-right"),o=se(e,"hotkey",19,()=>["altKey","KeyT"]),s=se(e,"expand",3,!1),a=se(e,"closeButton",3,!1),u=se(e,"offset",3,yh),c=se(e,"mobileOffset",3,xh),d=se(e,"theme",3,"light"),f=se(e,"richColors",3,!1),g=se(e,"duration",3,Lb),p=se(e,"visibleToasts",3,Ib),v=se(e,"toastOptions",19,()=>({})),m=se(e,"dir",7,"auto"),h=se(e,"gap",3,zb),x=se(e,"pauseWhenPageIsHidden",3,!1),_=se(e,"containerAriaLabel",3,"Notifications"),S=se(e,"closeButtonAriaLabel",3,"Close toast"),k=bh(e,["$$slots","$$events","$$legacy","invert","position","hotkey","expand","closeButton","offset","mobileOffset","theme","richColors","duration","visibleToasts","toastOptions","dir","gap","pauseWhenPageIsHidden","loadingIcon","successIcon","errorIcon","warningIcon","closeIcon","infoIcon","containerAriaLabel","class","closeButtonAriaLabel","onblur","onfocus","onmouseenter","onmousemove","onmouseleave","ondragend","onpointerdown","onpointerup"]);function b(){if(m()!=="auto")return m();if(typeof window>"u"||typeof document>"u")return"ltr";const I=document.documentElement.getAttribute("dir");return I==="auto"||!I?(Xt(()=>m(window.getComputedStyle(document.documentElement).direction??"ltr")),m()):(Xt(()=>m(I)),I)}const C=U(()=>Array.from(new Set([i(),...at.toasts.filter(I=>I.position).map(I=>I.position)].filter(Boolean))));let T=X(!1),O=X(!1),E=X(Be(t(d()))),D=X(void 0),L=X(null),V=X(!1);const J=U(()=>o().join("+").replace(/Key/g,"").replace(/Digit/g,""));nt(()=>{at.toasts.length<=1&&A(T,!1)}),nt(()=>{const I=at.toasts.filter(Y=>Y.dismiss&&!Y.delete);if(I.length>0){const Y=at.toasts.map(ie=>I.find(we=>we.id===ie.id)?{...ie,delete:!0}:ie);at.toasts=Y}}),nt(()=>()=>{l(D)&&l(L)&&(l(L).focus({preventScroll:!0}),A(L,null),A(V,!1))}),ht(()=>(at.reset(),ta(document,"keydown",Y=>{o().every(ue=>Y[ue]||Y.code===ue)&&(A(T,!0),l(D)?.focus()),Y.code==="Escape"&&(document.activeElement===l(D)||l(D)?.contains(document.activeElement))&&A(T,!1)}))),nt(()=>{if(d()!=="system"&&A(E,d()),typeof window<"u"){d()==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?A(E,ll):A(E,Es));const I=window.matchMedia("(prefers-color-scheme: dark)"),Y=({matches:ie})=>{d()==="system"&&A(E,ie?ll:Es,!0)};"addEventListener"in I?I.addEventListener("change",Y):I.addListener(Y)}});const R=I=>{e.onblur?.(I),l(V)&&!I.currentTarget.contains(I.relatedTarget)&&(A(V,!1),l(L)&&(l(L).focus({preventScroll:!0}),A(L,null)))},P=I=>{e.onfocus?.(I),!(I.target instanceof HTMLElement&&I.target.dataset.dismissible==="false")&&(l(V)||(A(V,!0),A(L,I.relatedTarget,!0)))},K=I=>{e.onpointerdown?.(I),!(I.target instanceof HTMLElement&&I.target.dataset.dismissible==="false")&&A(O,!0)},Q=I=>{e.onmouseenter?.(I),A(T,!0)},ee=I=>{e.onmouseleave?.(I),l(O)||A(T,!1)},H=I=>{e.onmousemove?.(I),A(T,!0)},j=I=>{e.ondragend?.(I),A(T,!1)},ne=I=>{e.onpointerup?.(I),A(O,!1)};rb.set(new ab);var B=jb();re(B,"tabindex",-1);var z=w(B);{var F=I=>{var Y=te(),ie=q(Y);Re(ie,18,()=>l(C),ue=>ue,(ue,we,me,ge)=>{const Te=U(()=>{const[he,et]=we.split("-");return{y:he,x:et}}),Ne=U(()=>Bb(u(),c()));var Oe=Ub();Yl(Oe,he=>({tabindex:-1,dir:he,class:e.class,"data-sonner-toaster":!0,"data-sonner-theme":l(E),"data-y-position":l(Te).y,"data-x-position":l(Te).x,style:e.style,onblur:R,onfocus:P,onmouseenter:Q,onmousemove:H,onmouseleave:ee,ondragend:j,onpointerdown:K,onpointerup:ne,...k,[Pi]:{"--front-toast-height":`${at.heights[0]?.height}px`,"--width":`${Rb}px`,"--gap":`${h()}px`,"--offset-top":l(Ne)["--offset-top"],"--offset-right":l(Ne)["--offset-right"],"--offset-bottom":l(Ne)["--offset-bottom"],"--offset-left":l(Ne)["--offset-left"],"--mobile-offset-top":l(Ne)["--mobile-offset-top"],"--mobile-offset-right":l(Ne)["--mobile-offset-right"],"--mobile-offset-bottom":l(Ne)["--mobile-offset-bottom"],"--mobile-offset-left":l(Ne)["--mobile-offset-left"]}}),[()=>b()],void 0,void 0,"svelte-dw134u"),Re(Oe,23,()=>at.toasts.filter(he=>!he.position&&l(me)===0||he.position===we),he=>he.id,(he,et,Ye,Ct)=>{{const Tt=ot=>{var Ze=te(),dt=q(Ze);{var Ie=De=>{var ut=te(),Nt=q(ut);Dt(Nt,()=>e.successIcon??Ot),y(De,ut)},qe=De=>{Eb(De)};W(dt,De=>{e.successIcon?De(Ie):e.successIcon!==null&&De(qe,1)})}y(ot,Ze)},Fe=ot=>{var Ze=te(),dt=q(Ze);{var Ie=De=>{var ut=te(),Nt=q(ut);Dt(Nt,()=>e.errorIcon??Ot),y(De,ut)},qe=De=>{Nb(De)};W(dt,De=>{e.errorIcon?De(Ie):e.errorIcon!==null&&De(qe,1)})}y(ot,Ze)},tt=ot=>{var Ze=te(),dt=q(Ze);{var Ie=De=>{var ut=te(),Nt=q(ut);Dt(Nt,()=>e.warningIcon??Ot),y(De,ut)},qe=De=>{Ob(De)};W(dt,De=>{e.warningIcon?De(Ie):e.warningIcon!==null&&De(qe,1)})}y(ot,Ze)},ye=ot=>{var Ze=te(),dt=q(Ze);{var Ie=De=>{var ut=te(),Nt=q(ut);Dt(Nt,()=>e.infoIcon??Ot),y(De,ut)},qe=De=>{Pb(De)};W(dt,De=>{e.infoIcon?De(Ie):e.infoIcon!==null&&De(qe,1)})}y(ot,Ze)},Ce=ot=>{var Ze=te(),dt=q(Ze);{var Ie=De=>{var ut=te(),Nt=q(ut);Dt(Nt,()=>e.closeIcon??Ot),y(De,ut)},qe=De=>{Fb(De)};W(dt,De=>{e.closeIcon?De(Ie):e.closeIcon!==null&&De(qe,1)})}y(ot,Ze)};let Pe=U(()=>v()?.duration??g()),Le=U(()=>v()?.class??""),Ke=U(()=>v()?.descriptionClass||""),je=U(()=>v()?.style??""),Me=U(()=>v().classes||{}),wt=U(()=>v().unstyled??!1),Pt=U(()=>v()?.cancelButtonStyle??""),Ve=U(()=>v()?.actionButtonStyle??""),lt=U(()=>v()?.closeButtonAriaLabel??S());kb(he,{get index(){return l(Ye)},get toast(){return l(et)},get defaultRichColors(){return f()},get duration(){return l(Pe)},get class(){return l(Le)},get descriptionClass(){return l(Ke)},get invert(){return r()},get visibleToasts(){return p()},get closeButton(){return a()},get interacting(){return l(O)},get position(){return we},get style(){return l(je)},get classes(){return l(Me)},get unstyled(){return l(wt)},get cancelButtonStyle(){return l(Pt)},get actionButtonStyle(){return l(Ve)},get closeButtonAriaLabel(){return l(lt)},get expandByDefault(){return s()},get expanded(){return l(T)},get pauseWhenPageIsHidden(){return x()},get loadingIcon(){return e.loadingIcon},successIcon:Tt,errorIcon:Fe,warningIcon:tt,infoIcon:ye,closeIcon:Ce,$$slots:{successIcon:!0,errorIcon:!0,warningIcon:!0,infoIcon:!0,closeIcon:!0}})}}),_n(Oe,he=>A(D,he),()=>l(D)),G(()=>Oe.dir=Oe.dir),y(ue,Oe)}),y(I,Y)};W(z,I=>{at.toasts.length>0&&I(F)})}G(()=>re(B,"aria-label",`${_()??""} ${l(J)??""}`)),y(n,B),de()}function Kb(n,e){const t=sd(e.pattern),r=sd(n),i={};for(let o=0;o<t.length;o++){const s=t[o];if(s==="*")return i.rest=r.slice(o).join("/"),{params:i};const a=r[o];if(a===void 0)return null;if(s.startsWith(":")){i[s.slice(1)]=decodeURIComponent(a);continue}if(s!==a)return null}return t.length!==r.length?null:{params:i}}function sd(n){return n.split("/").filter(Boolean)}let vn="/admin";function Hb(n){vn=n.endsWith("/")?n.slice(0,-1):n}class Vb{#e=X(Be({path:"/",params:{},query:new URLSearchParams,fullPath:vn+"/"}));get path(){return l(this.#e).path}get params(){return l(this.#e).params}get query(){return l(this.#e).query}get fullPath(){return l(this.#e).fullPath}_sync(e=[]){const{pathname:t,search:r}=window.location,i=Xb(t),o=new URLSearchParams(r);let s={};for(const a of e){const u=Kb(i,a);if(u){s=u.params;break}}A(this.#e,{path:i,params:s,query:o,fullPath:t},!0)}_set(e){A(this.#e,e,!0)}}const mr=new Vb;let Hi=[];function Jb(n){Hi=n,mr._sync(Hi)}function qb(n,e={}){const t=n.startsWith(vn+"/")||n===vn?n:n.startsWith("/")?vn+n:vn+"/"+n;t!==window.location.pathname+window.location.search&&(e.replace?window.history.replaceState({},"",t):window.history.pushState({},"",t),mr._sync(Hi))}const Tn=qb;function Je(n){return n.startsWith(vn)?n:n.startsWith("/")?vn+n:vn+"/"+n}const Zl=new Set;function Gb(n){return Zl.add(n),()=>Zl.delete(n)}function Yb(){let n=!1;const e=()=>{n=!0};for(const t of Zl)t(e);return!n}let ul=null,cl=null;function Zb(){ul||cl||(ul=n=>{if(n.defaultPrevented||n.button!==0||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey)return;const e=n.target?.closest("a");if(!e||e.target&&e.target!=="_self"||e.hasAttribute("download")||e.hasAttribute("data-external"))return;const t=e.getAttribute("href");if(!t)return;const r=new URL(t,window.location.origin);if(r.origin===window.location.origin&&r.pathname.startsWith(vn)){if(!Yb()){n.preventDefault();return}n.preventDefault(),window.history.pushState({},"",r.pathname+r.search),mr._sync(Hi)}},cl=()=>{mr._sync(Hi)},window.addEventListener("click",ul),window.addEventListener("popstate",cl),mr._sync(Hi))}function Xb(n){return n===vn?"/":n.startsWith(vn+"/")?n.slice(vn.length):n}const pn={get params(){return mr.params},get url(){return mr.fullPath,new URL(window.location.href)}},wh=Symbol("quoin.context");function Qb(n){pi(wh,n)}function ss(){const n=eo(wh);if(!n)throw new Error("quoin: context not initialized. Wrap your component tree in <AdminRoot> (or call setQuoinContext() directly in tests).");return n}function $b(n,e){if(e.slots[n])return e.slots[n];const t=n.split(".");for(let r=1;r<t.length;r++){const i=[...t];i[r]="*";const o=i.join(".");if(e.slots[o])return e.slots[o]}return null}function ey(n,e){if(e.views[n])return e.views[n];const t=n.split(".");for(let r=1;r<t.length;r++){const i=[...t];i[r]="*";const o=i.join(".");if(e.views[o])return e.views[o]}return null}const ad=new Map;async function Xu(n,e){const t=ad.get(n);if(t)return t;const r=e[n];if(!r)throw new Error(`quoin: component path "${n}" referenced in config but missing from importMap. If you just edited admin.config.ts, restart the dev server or rerun build:admin.`);const o=(await r()).default;return ad.set(n,o),o}async function as(n,e={}){const t=`/api${n}`,r=await fetch(t,{...e,credentials:"include",headers:{...e.body&&typeof e.body=="string"?{"Content-Type":"application/json"}:{},...e.headers}});if(!r.ok)try{const o=await r.json();return{ok:!1,error:o.error||"Request failed",details:o.details,status:r.status}}catch{return{ok:!1,error:`Request failed with status ${r.status}`,status:r.status}}return r.status===204?{ok:!0,data:void 0}:{ok:!0,data:await r.json()}}function jr(n){return as(n)}function _i(n,e){return as(n,{method:"POST",body:e!==void 0?JSON.stringify(e):void 0})}function Sh(n,e){return as(n,{method:"PUT",body:JSON.stringify(e)})}function kh(n){return as(n,{method:"DELETE"})}function Ch(n,e){return as(n,{method:"POST",body:e})}function ld(n,e){return _i("/auth/login",{email:n,password:e})}function ty(){return _i("/auth/logout")}function Eh(){return jr("/auth/me")}function ny(n,e){return _i("/auth/register",{username:n,password:e})}function ry(){return jr("/auth/setup-status")}const iy={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const oy=n=>{for(const e in n)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};const ud=(...n)=>n.filter((e,t,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===t).join(" ").trim();var sy=vo("<svg><!><!></svg>");function Ee(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]),r=Se(t,["name","color","size","strokeWidth","absoluteStrokeWidth","iconNode"]);ce(e,!1);let i=se(e,"name",8,void 0),o=se(e,"color",8,"currentColor"),s=se(e,"size",8,24),a=se(e,"strokeWidth",8,2),u=se(e,"absoluteStrokeWidth",8,!1),c=se(e,"iconNode",24,()=>[]);os();var d=sy();Yl(d,(p,v,m)=>({...iy,...p,...r,width:s(),height:s(),stroke:o(),"stroke-width":v,class:m}),[()=>oy(r)?void 0:{"aria-hidden":"true"},()=>(Jr(u()),Jr(a()),Jr(s()),Xt(()=>u()?Number(a())*24/Number(s()):a())),()=>(Jr(ud),Jr(i()),Jr(t),Xt(()=>ud("lucide-icon","lucide",i()?`lucide-${i()}`:"",t.class)))]);var f=w(d);Re(f,1,c,gt,(p,v)=>{var m=U(()=>_g(l(v),2));let h=()=>l(m)[0],x=()=>l(m)[1];var _=te(),S=q(_);M_(S,h,!0,(k,b)=>{Yl(k,()=>({...x()}))}),y(p,_)});var g=N(f);ke(g,e,"default",{}),y(n,d),de()}function ay(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8"}]];Ee(n,xe({name:"bold"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function ly(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M5 7a2 2 0 0 0-2 2v11"}],["path",{d:"M5.803 18H5a2 2 0 0 0 0 4h9.5a.5.5 0 0 0 .5-.5V21"}],["path",{d:"M9 15V4a2 2 0 0 1 2-2h9.5a.5.5 0 0 1 .5.5v14a.5.5 0 0 1-.5.5H11a2 2 0 0 1 0-4h10"}]];Ee(n,xe({name:"book-copy"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Io(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12 7v14"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z"}]];Ee(n,xe({name:"book-open"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function uy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M16 14v2.2l1.6 1"}],["path",{d:"M16 2v4"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5"}],["path",{d:"M3 10h5"}],["path",{d:"M8 2v4"}],["circle",{cx:"16",cy:"16",r:"6"}]];Ee(n,xe({name:"calendar-clock"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function cy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16"}],["path",{d:"M18 17V9"}],["path",{d:"M13 17V5"}],["path",{d:"M8 17v-3"}]];Ee(n,xe({name:"chart-column"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Th(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M20 6 9 17l-5-5"}]];Ee(n,xe({name:"check"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function ls(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m6 9 6 6 6-6"}]];Ee(n,xe({name:"chevron-down"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function dy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m15 18-6-6 6-6"}]];Ee(n,xe({name:"chevron-left"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Qu(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m9 18 6-6-6-6"}]];Ee(n,xe({name:"chevron-right"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function $u(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m18 15-6-6-6 6"}]];Ee(n,xe({name:"chevron-up"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function fy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m18 16 4-4-4-4"}],["path",{d:"m6 8-4 4 4 4"}],["path",{d:"m14.5 4-5 16"}]];Ee(n,xe({name:"code-xml"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function gy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m16 18 6-6-6-6"}],["path",{d:"m8 6-6 6 6 6"}]];Ee(n,xe({name:"code"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function hy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M9 3v18"}],["path",{d:"M15 3v18"}]];Ee(n,xe({name:"columns-3"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function vy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]];Ee(n,xe({name:"copy"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function py(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12 15V3"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["path",{d:"m7 10 5 5 5-5"}]];Ee(n,xe({name:"download"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function my(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"12",cy:"5",r:"1"}],["circle",{cx:"12",cy:"19",r:"1"}]];Ee(n,xe({name:"ellipsis-vertical"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function _y(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M15 3h6v6"}],["path",{d:"M10 14 21 3"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}]];Ee(n,xe({name:"external-link"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Nh(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}],["circle",{cx:"12",cy:"12",r:"3"}]];Ee(n,xe({name:"eye"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function ec(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}],["path",{d:"M10 9H8"}],["path",{d:"M16 13H8"}],["path",{d:"M16 17H8"}]];Ee(n,xe({name:"file-text"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function na(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"}]];Ee(n,xe({name:"folder-open"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function by(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3"}]];Ee(n,xe({name:"folder-tree"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function yy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M4 12h8"}],["path",{d:"M4 18V6"}],["path",{d:"M12 18V6"}],["path",{d:"m17 12 3-2v8"}]];Ee(n,xe({name:"heading-1"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function xy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M4 12h8"}],["path",{d:"M4 18V6"}],["path",{d:"M12 18V6"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2"}]];Ee(n,xe({name:"heading-3"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function wy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M4 12h8"}],["path",{d:"M4 18V6"}],["path",{d:"M12 18V6"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1"}]];Ee(n,xe({name:"heading-2"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Sy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}],["path",{d:"M3 3v5h5"}],["path",{d:"M12 7v5l4 2"}]];Ee(n,xe({name:"history"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Xl(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}],["circle",{cx:"9",cy:"9",r:"2"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"}]];Ee(n,xe({name:"image"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function ky(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["line",{x1:"19",x2:"10",y1:"4",y2:"4"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20"}]];Ee(n,xe({name:"italic"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Cy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1"}]];Ee(n,xe({name:"layout-grid"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Ey(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M11 5h10"}],["path",{d:"M11 12h10"}],["path",{d:"M11 19h10"}],["path",{d:"M4 4h1v5"}],["path",{d:"M4 9h2"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02"}]];Ee(n,xe({name:"list-ordered"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Ah(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M3 5h.01"}],["path",{d:"M3 12h.01"}],["path",{d:"M3 19h.01"}],["path",{d:"M8 5h13"}],["path",{d:"M8 12h13"}],["path",{d:"M8 19h13"}]];Ee(n,xe({name:"list"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Ty(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1"}]];Ee(n,xe({name:"lock-open"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Ny(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4"}]];Ee(n,xe({name:"lock"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Ay(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m16 17 5-5-5-5"}],["path",{d:"M21 12H9"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}]];Ee(n,xe({name:"log-out"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Oy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}]];Ee(n,xe({name:"mail"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function My(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14"}],["path",{d:"M8 6v8"}]];Ee(n,xe({name:"megaphone"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Py(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M4 5h16"}],["path",{d:"M4 12h16"}],["path",{d:"M4 19h16"}]];Ee(n,xe({name:"menu"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Dy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"}]];Ee(n,xe({name:"message-square"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Fy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M14 4.1 12 6"}],["path",{d:"m5.1 8-2.9-.8"}],["path",{d:"m6 12-1.9 2"}],["path",{d:"M7.2 2.2 8 5.1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z"}]];Ee(n,xe({name:"mouse-pointer-click"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Iy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M9 3v18"}],["path",{d:"m16 15-3-3 3-3"}]];Ee(n,xe({name:"panel-left-close"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Ly(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M9 3v18"}],["path",{d:"m14 9 3 3-3 3"}]];Ee(n,xe({name:"panel-left-open"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Ry(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M13 21h8"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}]];Ee(n,xe({name:"pen-line"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function zy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}],["path",{d:"m15 5 4 4"}]];Ee(n,xe({name:"pencil"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function tc(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];Ee(n,xe({name:"plus"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function By(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z"}]];Ee(n,xe({name:"puzzle"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Oh(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z"}]];Ee(n,xe({name:"quote"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Uy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m15 14 5-5-5-5"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13"}]];Ee(n,xe({name:"redo-2"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function jy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}],["path",{d:"M3 3v5h5"}]];Ee(n,xe({name:"rotate-ccw"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function nc(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m21 21-4.34-4.34"}],["circle",{cx:"11",cy:"11",r:"8"}]];Ee(n,xe({name:"search"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Wy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"}],["circle",{cx:"12",cy:"12",r:"3"}]];Ee(n,xe({name:"settings"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Ky(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5"}]];Ee(n,xe({name:"sticky-note"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Hy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12"}]];Ee(n,xe({name:"strikethrough"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Vy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor"}]];Ee(n,xe({name:"tag"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Jy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor"}]];Ee(n,xe({name:"tags"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Mh(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M10 11v6"}],["path",{d:"M14 11v6"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]];Ee(n,xe({name:"trash-2"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function qy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}],["path",{d:"M12 9v4"}],["path",{d:"M12 17h.01"}]];Ee(n,xe({name:"triangle-alert"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Gy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18"}],["path",{d:"M4 22h16"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6"}]];Ee(n,xe({name:"trophy"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Yy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M9 14 4 9l5-5"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11"}]];Ee(n,xe({name:"undo-2"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Zy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20"}]];Ee(n,xe({name:"underline"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Ho(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12 3v12"}],["path",{d:"m17 8-5-5-5 5"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}]];Ee(n,xe({name:"upload"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Xy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}],["circle",{cx:"9",cy:"7",r:"4"}]];Ee(n,xe({name:"users"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function or(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];Ee(n,xe({name:"x"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Qy(n,e){const t=Se(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17"}],["path",{d:"m10 15 5-3-5-3z"}]];Ee(n,xe({name:"youtube"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=te(),a=q(s);ke(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Ph(n){return jr(`/globals/${n}`)}function $y(n,e){return Sh(`/globals/${n}`,e)}const vt=Be({siteName:"Quoin",logoUrl:null,faviconUrl:null});let cd=!1;function ex(){try{const n=ss();n.config.brand.name&&(vt.siteName=n.config.brand.name),n.config.brand.logo&&(vt.logoUrl=n.config.brand.logo)}catch{}}async function Dh(){if(cd)return;cd=!0;const n=await Ph("site-settings");if(!n.ok)return;const e=n.data??{};typeof e.siteName=="string"&&e.siteName.trim()&&(vt.siteName=e.siteName.trim()),e.logo&&typeof e.logo=="object"&&typeof e.logo.url=="string"?vt.logoUrl=e.logo.url:typeof e.logo=="string"&&e.logo&&(vt.logoUrl=e.logo),e.favicon&&typeof e.favicon=="object"&&typeof e.favicon.url=="string"?vt.faviconUrl=e.favicon.url:typeof e.favicon=="string"&&e.favicon&&(vt.faviconUrl=e.favicon)}var tx=M('<span class="text-xs text-red-500"> </span>');function ra(n,e){ce(e,!0);let t=bh(e,["$$slots","$$events","$$legacy","name","children"]);const r=ss(),i=$b(e.name,r.config);let o=X(null),s=X(null);ht(async()=>{if(i)try{A(o,await Xu(i,r.importMap),!0)}catch(f){A(s,f instanceof Error?f.message:String(f),!0),console.error(`[quoin:Slot] Failed to load override for "${e.name}":`,f)}});var a=te(),u=q(a);{var c=f=>{var g=te(),p=q(g);{var v=h=>{const x=U(()=>l(o));var _=te(),S=q(_);Vt(S,()=>l(x),(k,b)=>{b(k,xe(()=>t))}),y(h,_)},m=h=>{var x=tx(),_=w(x);G(()=>{re(x,"title",l(s)),$(_,`slot load error: ${e.name??""}`)}),y(h,x)};W(p,h=>{l(o)?h(v):l(s)&&h(m,1)})}y(f,g)},d=f=>{var g=te(),p=q(g);Dt(p,()=>e.children,()=>t),y(f,g)};W(u,f=>{i?f(c):e.children&&f(d,1)})}y(n,a),de()}var nx=M('<div class="flex h-screen items-center justify-center bg-background"><div class="flex h-10 w-10 items-center justify-center rounded-xl bg-primary/10"><!></div></div>'),rx=M('<img class="h-20 w-auto max-w-[280px] object-contain"/>'),ix=M('<div class="flex h-16 w-16 items-center justify-center rounded-2xl bg-sidebar-accent"><!></div>'),ox=M('<h1 class="text-3xl font-semibold tracking-tight text-white" style="font-family: var(--font-display);"> </h1>'),sx=M('<p class="mt-3 text-base leading-relaxed text-sidebar-foreground/70" style="font-family: var(--font-display); font-style: italic;"> </p>'),ax=M('<img class="h-14 w-auto max-w-[220px] object-contain"/>'),lx=M('<div class="mb-3 flex h-12 w-12 items-center justify-center rounded-xl bg-primary/10"><!></div> <h1 class="text-xl font-semibold" style="font-family: var(--font-display);"> </h1>',1),ux=M('<div><label for="confirmPassword" class="mb-2 block text-[13px] font-medium text-foreground">Confirm Password</label> <input id="confirmPassword" type="password" class="h-11 w-full rounded-lg border border-border bg-card px-3.5 text-sm shadow-sm transition-all placeholder:text-muted-foreground/50 focus:border-primary/40 focus:outline-none focus:ring-2 focus:ring-primary/10" placeholder="Confirm password" autocomplete="new-password"/></div>'),cx=M('<div class="flex min-h-screen"><div class="relative hidden w-1/2 overflow-hidden bg-sidebar-background lg:flex lg:flex-col lg:items-center lg:justify-center"><div class="absolute inset-0 opacity-[0.03]" style="background-image: radial-gradient(circle at 1px 1px, white 1px, transparent 0); background-size: 32px 32px;"></div> <div class="relative z-10 max-w-md px-12 text-center"><div class="mb-8 flex justify-center"><!></div> <!> <!> <div class="mx-auto mt-8 h-px w-16 bg-sidebar-accent/40"></div></div></div> <div class="flex flex-1 items-center justify-center bg-background p-6"><div class="w-full max-w-sm"><div class="mb-8 flex flex-col items-center lg:hidden"><!></div> <div class="mb-8"><h2 class="text-xl font-semibold tracking-tight" style="font-family: var(--font-display);"> </h2> <p class="mt-1.5 text-sm text-muted-foreground"> </p></div> <form class="space-y-5"><div><label for="email" class="mb-2 block text-[13px] font-medium text-foreground">Email</label> <input id="email" type="email" class="h-11 w-full rounded-lg border border-border bg-card px-3.5 text-sm shadow-sm transition-all placeholder:text-muted-foreground/50 focus:border-primary/40 focus:outline-none focus:ring-2 focus:ring-primary/10" placeholder="you@example.com" autocomplete="email"/></div> <div><label for="password" class="mb-2 block text-[13px] font-medium text-foreground">Password</label> <input id="password" type="password" class="h-11 w-full rounded-lg border border-border bg-card px-3.5 text-sm shadow-sm transition-all placeholder:text-muted-foreground/50 focus:border-primary/40 focus:outline-none focus:ring-2 focus:ring-primary/10" placeholder="Enter password"/></div> <!> <button type="submit" class="h-11 w-full rounded-lg bg-primary text-sm font-medium text-primary-foreground shadow-sm transition-all hover:bg-primary/90 hover:shadow-md active:scale-[0.99] disabled:opacity-50 disabled:shadow-none"> </button></form> <div class="mt-6 text-center"><button type="button" class="text-[13px] text-muted-foreground transition-colors hover:text-primary"> </button></div></div></div></div>');function dx(n,e){ce(e,!0);let t=X(""),r=X(""),i=X(""),o=X(!1),s=X(!1),a=X(!0);ht(async()=>{if(Dh(),(await Eh()).ok){await Tn(Je("/"));return}const h=await ry();h.ok&&h.data.needsSetup&&A(o,!0),A(a,!1)});async function u(){if(!l(t)||!l(r)){ze.error("Please enter email and password");return}A(s,!0);const m=await ld(l(t),l(r));A(s,!1),m.ok?await Tn(Je("/")):m.status===401?ze.error("Invalid credentials"):ze.error(m.error)}async function c(){if(!l(t)||!l(r)){ze.error("Please enter email and password");return}if(l(r)!==l(i)){ze.error("Passwords do not match");return}if(l(r).length<6){ze.error("Password must be at least 6 characters");return}A(s,!0);const m=await ny(l(t),l(r));A(s,!1),m.ok?(ze.success("Admin account created! Logging in..."),(await ld(l(t),l(r))).ok?await Tn(Je("/")):(ze.error("Account created but login failed. Please try logging in."),A(o,!1))):ze.error(m.error)}function d(){A(o,!l(o)),A(i,"")}var f=te(),g=q(f);{var p=m=>{var h=nx(),x=w(h),_=w(x);Io(_,{class:"h-5 w-5 text-primary animate-spin-slow"}),y(m,h)},v=m=>{var h=cx(),x=w(h),_=N(w(x),2),S=w(_),k=w(S);ra(k,{name:"branding.logo",get siteName(){return vt.siteName},get logoUrl(){return vt.logoUrl},children:Te=>{var Ne=te(),Oe=q(Ne);{var he=Ye=>{var Ct=rx();G(()=>{re(Ct,"src",vt.logoUrl),re(Ct,"alt",vt.siteName)}),y(Ye,Ct)},et=Ye=>{var Ct=ix(),Tt=w(Ct);Io(Tt,{class:"h-8 w-8 text-sidebar-accent-foreground"}),y(Ye,Ct)};W(Oe,Ye=>{vt.logoUrl?Ye(he):Ye(et,-1)})}y(Te,Ne)},$$slots:{default:!0}});var b=N(S,2);{var C=ge=>{var Te=ox(),Ne=w(Te);G(()=>$(Ne,vt.siteName)),y(ge,Te)};W(b,ge=>{vt.logoUrl||ge(C)})}var T=N(b,2);ra(T,{name:"login.tagline",children:Te=>{var Ne=sx(),Oe=w(Ne);G(()=>$(Oe,`${vt.siteName??""} Admin`)),y(Te,Ne)},$$slots:{default:!0}});var O=N(x,2),E=w(O),D=w(E),L=w(D);{var V=ge=>{var Te=ax();G(()=>{re(Te,"src",vt.logoUrl),re(Te,"alt",vt.siteName)}),y(ge,Te)},J=ge=>{var Te=lx(),Ne=q(Te),Oe=w(Ne);Io(Oe,{class:"h-6 w-6 text-primary"});var he=N(Ne,2),et=w(he);G(()=>$(et,vt.siteName)),y(ge,Te)};W(L,ge=>{vt.logoUrl?ge(V):ge(J,-1)})}var R=N(D,2),P=w(R),K=w(P),Q=N(P,2),ee=w(Q),H=N(R,2),j=w(H),ne=N(w(j),2),B=N(j,2),z=N(w(B),2),F=N(B,2);{var I=ge=>{var Te=ux(),Ne=N(w(Te),2);zt(Ne,()=>l(i),Oe=>A(i,Oe)),y(ge,Te)};W(F,ge=>{l(o)&&ge(I)})}var Y=N(F,2),ie=w(Y),ue=N(H,2),we=w(ue),me=w(we);G(()=>{$(K,l(o)?"Create your account":"Sign in"),$(ee,l(o)?"Set up the first admin account to get started.":"Enter your credentials to continue."),re(z,"autocomplete",l(o)?"new-password":"current-password"),Y.disabled=l(s),$(ie,l(s)?"Please wait...":l(o)?"Create Account":"Sign In"),$(me,l(o)?"Already have an account? Sign in":"First time? Create admin account")}),Bn("submit",H,ge=>{ge.preventDefault(),l(o)?c():u()}),zt(ne,()=>l(t),ge=>A(t,ge)),zt(z,()=>l(r),ge=>A(r,ge)),Z("click",we,d),y(m,h)};W(g,m=>{l(a)?m(p):m(v,-1)})}y(n,f),de()}ve(["click"]);function fx(){return jr("/_schema")}const en=Be({collections:[],globals:[]});function po(n,e){return n.find(t=>t.key===e)}var gx=M('<img class="h-9 w-auto max-w-[180px] object-contain"/>'),hx=M('<div class="flex h-8 w-8 items-center justify-center rounded-lg bg-sidebar-accent"><!></div> <div class="flex flex-col"><span class="text-sm font-semibold tracking-tight text-white" style="font-family: var(--font-display);"> </span> <span class="text-[10px] uppercase tracking-widest text-sidebar-muted">Admin</span></div>',1),vx=M("<li><a><!> </a></li>"),px=M('<div class="mb-5"><p class="mb-2 px-3 text-[10px] font-semibold uppercase tracking-[0.15em] text-sidebar-muted"> </p> <ul class="space-y-0.5"></ul></div>'),mx=M("<li><a><!> </a></li>"),_x=M('<div class="mb-5"><p class="mb-2 px-3 text-[10px] font-semibold uppercase tracking-[0.15em] text-sidebar-muted"> </p> <ul class="space-y-0.5"></ul></div>'),bx=M("<li><a><!> </a></li>"),yx=M('<div class="mb-5"><p class="mb-2 px-3 text-[10px] font-semibold uppercase tracking-[0.15em] text-sidebar-muted">Settings</p> <ul class="space-y-0.5"></ul></div>'),xx=M('<aside class="flex h-full w-64 flex-col bg-sidebar-background text-sidebar-foreground"><div class="flex h-16 items-center justify-between px-5"><a class="flex min-w-0 items-center gap-2.5"><!></a> <button class="rounded-md p-1.5 text-sidebar-muted transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground" title="Collapse sidebar"><!></button></div> <div class="mx-4 border-t border-sidebar-border"></div> <nav class="flex-1 overflow-y-auto px-3 py-4 scrollbar-hide"><!> <!> <!></nav> <div class="border-t border-sidebar-border px-4 py-3"><div class="flex items-center justify-between"><div class="flex items-center gap-2.5"><div class="flex h-7 w-7 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-semibold text-sidebar-accent-foreground"> </div> <span class="text-xs text-sidebar-foreground"> </span></div> <button class="rounded-md p-1.5 text-sidebar-muted transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground" title="Logout"><!></button></div></div></aside>'),wx=M('<button class="fixed left-3 top-4 z-50 rounded-lg border border-border bg-card p-2 shadow-md transition-colors hover:bg-secondary" title="Open sidebar"><!></button>');function Sx(n,e){ce(e,!0);const t=ss(),r=U(()=>{const h={};for(const[x,_]of Object.entries(t.config.pages)){if(!_.nav)continue;const S=_.nav.group??"Tools";h[S]||(h[S]=[]),h[S].push({slug:x,label:_.nav.label,icon:_.nav.icon})}return h}),i={posts:Ry,authors:Xy,categories:by,tags:Vy,series:ly,competitions:Gy,ads:My,subscribers:Oy,pages:Ky,menus:Py,media:Xl,media_folders:na,media_tags:Jy,contact_messages:Dy,ad_impressions:cy,ad_clicks:Fy};function o(h){return i[h]||ec}let s=se(e,"open",15,!0),a=U(()=>{const h={};for(const x of e.collections){const _=x.admin?.group||"Collections";h[_]||(h[_]=[]),h[_].push(x)}for(const x of Object.values(h))x.sort((_,S)=>_.label.localeCompare(S.label));return h}),u=U(()=>Object.keys(l(a)).sort()),c=U(()=>pn.url.pathname);function d(h){return l(c)===h||l(c).startsWith(`${h}/`)}async function f(){(await ty()).ok?await Tn(Je("/login")):ze.error("Logout failed")}var g=te(),p=q(g);{var v=h=>{var x=xx(),_=w(x),S=w(_),k=w(S);ra(k,{name:"branding.logo",get siteName(){return vt.siteName},get logoUrl(){return vt.logoUrl},children:B=>{var z=te(),F=q(z);{var I=ie=>{var ue=gx();G(()=>{re(ue,"src",vt.logoUrl),re(ue,"alt",vt.siteName)}),y(ie,ue)},Y=ie=>{var ue=hx(),we=q(ue),me=w(we);Io(me,{class:"h-4 w-4 text-sidebar-accent-foreground"});var ge=N(we,2),Te=w(ge),Ne=w(Te);G(()=>$(Ne,vt.siteName)),y(ie,ue)};W(F,ie=>{vt.logoUrl?ie(I):ie(Y,-1)})}y(B,z)},$$slots:{default:!0}});var b=N(S,2),C=w(b);Iy(C,{class:"h-4 w-4"});var T=N(_,4),O=w(T);Re(O,17,()=>l(u),gt,(ne,B)=>{var z=px(),F=w(z),I=w(F),Y=N(F,2);Re(Y,21,()=>l(a)[l(B)],gt,(ie,ue)=>{const we=U(()=>o(l(ue).key));var me=vx(),ge=w(me),Te=w(ge);{let Oe=U(()=>d(Je(`/${l(ue).key}`))?"opacity-100":"");Vt(Te,()=>l(we),(he,et)=>{et(he,{get class(){return`h-4 w-4 shrink-0 opacity-60 group-hover:opacity-100 ${l(Oe)??""}`}})})}var Ne=N(Te);G((Oe,he)=>{re(ge,"href",Oe),be(ge,1,`group flex items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] transition-all duration-150
|
|
3
|
-
${he??""}`),$(Ne,` ${(l(ue).labelPlural||l(ue).label)??""}`)},[()=>Je(`/${l(ue).key}`),()=>d(Je(`/${l(ue).key}`))?"bg-sidebar-accent text-sidebar-accent-foreground font-medium shadow-sm":"text-sidebar-foreground hover:bg-white/[0.04] hover:text-white"]),y(ie,me)}),G(()=>$(I,l(B))),y(ne,z)});var E=N(O,2);Re(E,17,()=>Object.entries(l(r)),gt,(ne,B)=>{var z=U(()=>_g(l(B),2));let F=()=>l(z)[0],I=()=>l(z)[1];var Y=_x(),ie=w(Y),ue=w(ie),we=N(ie,2);Re(we,21,I,gt,(me,ge)=>{const Te=U(()=>Je(`/pages/${l(ge).slug}`));var Ne=mx(),Oe=w(Ne),he=w(Oe);{let Ye=U(()=>d(l(Te))?"opacity-100":"");By(he,{get class(){return`h-4 w-4 shrink-0 opacity-60 group-hover:opacity-100 ${l(Ye)??""}`}})}var et=N(he);G(Ye=>{re(Oe,"href",l(Te)),be(Oe,1,`group flex items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] transition-all duration-150
|
|
4
|
-
${Ye??""}`),$(et,` ${l(ge).label??""}`)},[()=>d(l(Te))?"bg-sidebar-accent text-sidebar-accent-foreground font-medium shadow-sm":"text-sidebar-foreground hover:bg-white/[0.04] hover:text-white"]),y(me,Ne)}),G(()=>$(ue,F())),y(ne,Y)});var D=N(E,2);{var L=ne=>{var B=yx(),z=N(w(B),2);Re(z,21,()=>e.globals,gt,(F,I)=>{var Y=bx(),ie=w(Y),ue=w(ie);{let me=U(()=>d(Je(`/globals/${l(I).key}`))?"opacity-100":"");Wy(ue,{get class(){return`h-4 w-4 shrink-0 opacity-60 group-hover:opacity-100 ${l(me)??""}`}})}var we=N(ue);G((me,ge)=>{re(ie,"href",me),be(ie,1,`group flex items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] transition-all duration-150
|
|
5
|
-
${ge??""}`),$(we,` ${l(I).label??""}`)},[()=>Je(`/globals/${l(I).key}`),()=>d(Je(`/globals/${l(I).key}`))?"bg-sidebar-accent text-sidebar-accent-foreground font-medium shadow-sm":"text-sidebar-foreground hover:bg-white/[0.04] hover:text-white"]),y(F,Y)}),y(ne,B)};W(D,ne=>{e.globals.length>0&&ne(L)})}var V=N(T,2),J=w(V),R=w(J),P=w(R),K=w(P),Q=N(P,2),ee=w(Q),H=N(R,2),j=w(H);Ay(j,{class:"h-3.5 w-3.5"}),G((ne,B)=>{re(S,"href",ne),$(K,B),$(ee,e.user?.username)},[()=>Je("/"),()=>e.user?.username?.charAt(0)?.toUpperCase()||"?"]),Z("click",b,()=>s(!1)),Z("click",H,f),y(h,x)},m=h=>{var x=wx(),_=w(x);Ly(_,{class:"h-4 w-4"}),Z("click",x,()=>s(!0)),y(h,x)};W(p,h=>{s()?h(v):h(m,-1)})}y(n,g),de()}ve(["click"]);var kx=M('<a class="text-muted-foreground transition-colors hover:text-foreground"> </a>'),Cx=M('<span class="font-medium text-foreground"> </span>'),Ex=M("<!> <!>",1),Tx=M('<a class="inline-flex h-8 items-center gap-1.5 rounded-lg bg-primary px-3.5 text-[13px] font-medium text-primary-foreground shadow-sm transition-all hover:bg-primary/90 hover:shadow-md active:scale-[0.98]"><!> Add New</a>'),Nx=M('<header><nav class="flex items-center gap-1.5 text-sm"></nav> <!></header>');function Ax(n,e){ce(e,!0);let t=se(e,"sidebarOpen",11,!0),r=U(()=>pn.url.pathname),i=U(()=>{const f=l(r).slice(Je("/").length).split("/").filter(Boolean),g=[];if(f.length===0)return g.push({label:"Dashboard"}),g;if(f[0]==="files")return g.push({label:"Files"}),g;if(f[0]==="globals"&&f[1]){const v=e.globals.find(m=>m.key===f[1]);return g.push({label:"Settings",href:void 0}),g.push({label:v?.label||f[1]}),g}if(f[0]==="login")return g.push({label:"Login"}),g;const p=e.collections.find(v=>v.key===f[0]);return p?(g.push({label:p.labelPlural||p.label,href:Je(`/${p.key}`)}),f[1]==="new"?g.push({label:"New"}):f[1]&&g.push({label:"Edit"})):g.push({label:f[0]}),g}),o=U(()=>{const f=l(r).slice(Je("/").length).split("/").filter(Boolean);return f.length===1?e.collections.some(g=>g.key===f[0]):!1}),s=U(()=>{const f=l(r).slice(Je("/").length).split("/").filter(Boolean);if(f.length>=1){const g=e.collections.find(p=>p.key===f[0]);if(g)return g.key}return null});var a=Nx(),u=w(a);Re(u,21,()=>l(i),gt,(f,g,p)=>{var v=Ex(),m=q(v);{var h=k=>{Qu(k,{class:"h-3 w-3 text-muted-foreground/50"})};W(m,k=>{p>0&&k(h)})}var x=N(m,2);{var _=k=>{var b=kx(),C=w(b);G(()=>{re(b,"href",l(g).href),$(C,l(g).label)}),y(k,b)},S=k=>{var b=Cx(),C=w(b);G(()=>$(C,l(g).label)),y(k,b)};W(x,k=>{l(g).href&&p<l(i).length-1?k(_):k(S,-1)})}y(f,v)});var c=N(u,2);{var d=f=>{var g=Tx(),p=w(g);tc(p,{class:"h-3.5 w-3.5"}),G(v=>re(g,"href",v),[()=>Je(`/${l(s)}/new`)]),y(f,g)};W(c,f=>{l(o)&&l(s)&&f(d)})}G(()=>be(a,1,`flex h-14 items-center justify-between border-b border-border/60 bg-card/80 px-6 backdrop-blur-sm ${t()?"":"pl-14"}`)),y(n,a),de()}var Ox=M('<div class="flex h-screen flex-col items-center justify-center gap-4 bg-background"><div class="flex items-center gap-3"><div class="flex h-10 w-10 items-center justify-center rounded-xl bg-primary/10"><!></div></div> <p class="text-sm text-muted-foreground">Loading admin panel...</p></div>'),Mx=M('<div class="mx-auto max-w-7xl animate-fade-in"><!></div>'),Px=M('<div class="flex h-screen overflow-hidden bg-background"><!> <div class="flex flex-1 flex-col overflow-hidden"><!> <main><!></main></div></div>');function Dx(n,e){ce(e,!0);let t=U(()=>/^\/(admin\/)?[^/]+\/(new|[^/]+)$/.test(pn.url.pathname.replace(/^\/admin/,""))),r=X(!0),i=X(null),o=X(!0);ht(async()=>{const d=await Eh();if(!d.ok){await Tn(Je("/login"));return}A(i,d.data,!0);const f=await fx();if(!f.ok){await Tn(Je("/login"));return}en.collections=f.data.collections,en.globals=f.data.globals,Dh(),A(r,!1)});var s=te(),a=q(s);{var u=d=>{var f=Ox(),g=w(f),p=w(g),v=w(p);Io(v,{class:"h-5 w-5 text-primary animate-spin-slow"}),y(d,f)},c=d=>{var f=Px(),g=w(f);Sx(g,{get collections(){return en.collections},get globals(){return en.globals},get user(){return l(i)},get open(){return l(o)},set open(k){A(o,k,!0)}});var p=N(g,2),v=w(p);{var m=k=>{Ax(k,{get collections(){return en.collections},get globals(){return en.globals},get sidebarOpen(){return l(o)},set sidebarOpen(b){A(o,b,!0)}})};W(v,k=>{l(t)||k(m)})}var h=N(v,2),x=w(h);{var _=k=>{var b=te(),C=q(b);Dt(C,()=>e.children),y(k,b)},S=k=>{var b=Mx(),C=w(b);Dt(C,()=>e.children),y(k,b)};W(x,k=>{l(t)?k(_):k(S,-1)})}G(()=>be(h,1,`flex-1 overflow-y-auto ${l(t)?"":"p-6"}`)),y(d,f)};W(a,d=>{l(r)?d(u):d(c,-1)})}y(n,s),de()}var Fx=M('<div class="rounded-lg border border-dashed border-border bg-card p-12 text-center"><p class="text-sm text-muted-foreground">No collections registered yet. Add a <code class="font-mono text-xs">*quoin.Collection</code> in your Go config to get started.</p></div>'),Ix=M('<a class="group rounded-lg border border-border/60 bg-card p-4 shadow-sm transition-all hover:border-border hover:shadow"><p class="text-sm font-medium text-muted-foreground"> </p> <p class="mt-2 text-3xl font-semibold tracking-tight tabular-nums"><!></p> <p class="mt-2 text-xs text-muted-foreground group-hover:text-foreground">View all →</p></a>'),Lx=M('<section class="grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4"></section>'),Rx=M(`<div class="mx-auto max-w-7xl space-y-6"><header class="flex flex-wrap items-start justify-between gap-4"><div><h1 class="text-2xl font-semibold tracking-tight" style="font-family: var(--font-display);"> </h1> <p class="mt-1 text-sm text-muted-foreground">Manage your content from the sidebar, or override this dashboard via <code class="font-mono text-xs">admin.config.ts</code> → <code class="font-mono text-xs">views['dashboard.main']</code>.</p></div> <div class="flex items-center gap-2"><!></div></header> <!></div>`);function dd(n,e){ce(e,!0);let t=Be({});async function r(v){try{const m=await fetch(`/api/collections/${v}/records?limit=1`,{credentials:"include"});if(!m.ok)return{value:null,error:!0};const h=await m.json(),x=typeof h?.total=="number"?h.total:typeof h?.totalRecords=="number"?h.totalRecords:Array.isArray(h?.records)?h.records.length:null;return{value:x,error:x===null}}catch{return{value:null,error:!0}}}nt(()=>{const v=en.collections;if(v.length!==0)for(const m of v)t[m.key]===void 0&&(t[m.key]={value:null,error:!1},r(m.key).then(h=>{t[m.key]=h}))});var i=Rx(),o=w(i),s=w(o),a=w(s),u=w(a),c=N(s,2),d=w(c);ra(d,{name:"dashboard.actions"});var f=N(o,2);{var g=v=>{var m=Fx();y(v,m)},p=v=>{var m=Lx();Re(m,21,()=>en.collections,h=>h.key,(h,x)=>{const _=U(()=>t[l(x).key]);var S=Ix(),k=w(S),b=w(k),C=N(k,2),T=w(C);{var O=D=>{var L=xr();G(()=>$(L,l(_)?.error?"—":"…")),y(D,L)},E=D=>{var L=xr();G(()=>$(L,l(_).value)),y(D,L)};W(T,D=>{l(_)===void 0||l(_).value===null?D(O):D(E,-1)})}G(D=>{re(S,"href",D),$(b,l(x).labelPlural||l(x).label)},[()=>Je(`/${l(x).key}`)]),y(h,S)}),y(v,m)};W(f,v=>{en.collections.length===0?v(g):v(p,-1)})}G(()=>$(u,`Welcome to ${(vt.siteName||"your CMS")??""}`)),y(n,i),de()}var zx=M('<div class="p-6 text-red-600"> </div> <!>',1),Bx=M('<div class="p-6 text-muted-foreground">Loading dashboard…</div>');function Ux(n,e){ce(e,!0);const t=ss(),r=U(()=>ey("dashboard.main",t.config));let i=X(null),o=X(null);nt(()=>{A(i,null),A(o,null),l(r)&&Xu(l(r),t.importMap).then(g=>{A(i,g,!0)}).catch(g=>{A(o,g instanceof Error?g.message:String(g),!0),console.error("[quoin:DashboardSlot] Failed to load override:",g)})});var s=te(),a=q(s);{var u=g=>{dd(g,{})},c=g=>{var p=zx(),v=q(p),m=w(v),h=N(v,2);dd(h,{}),G(()=>$(m,`Failed to load dashboard override: ${l(o)??""}`)),y(g,p)},d=g=>{const p=U(()=>l(i));var v=te(),m=q(v);Vt(m,()=>l(p),(h,x)=>{x(h,{})}),y(g,v)},f=g=>{var p=Bx();y(g,p)};W(a,g=>{l(r)?l(o)?g(c,1):l(i)?g(d,2):g(f,-1):g(u)})}y(n,s),de()}const Fh=[{name:"createdAt",type:"date",label:"Created",required:!1},{name:"updatedAt",type:"date",label:"Updated",required:!1}];function Vo(n,e={}){const t=new URLSearchParams;e.page&&t.set("page",String(e.page)),e.perPage&&t.set("perPage",String(e.perPage)),e.sort&&t.set("sort",e.sort),e.filter&&t.set("filter",e.filter),e.search&&t.set("search",e.search),e.expand&&t.set("expand",e.expand),e.fields&&t.set("fields",e.fields);const r=t.toString();return jr(`/collections/${n}/records${r?`?${r}`:""}`)}function ia(n,e,t,r){const i=new URLSearchParams;t&&i.set("expand",t),r?.draft&&i.set("draft","true");const o=i.toString();return jr(`/collections/${n}/records/${e}${o?"?"+o:""}`)}function Ql(n,e,t){const r=new URLSearchParams;t?.draft&&r.set("draft","true"),t?.autosave&&r.set("autosave","true");const i=r.toString();return _i(`/collections/${n}/records${i?"?"+i:""}`,e)}function Ih(n,e,t,r){const i=new URLSearchParams;r?.draft&&i.set("draft","true"),r?.autosave&&i.set("autosave","true");const o=i.toString();return Sh(`/collections/${n}/records/${e}${o?"?"+o:""}`,t)}function Lh(n,e){return kh(`/collections/${n}/records/${e}`)}function jx(n,e){return _i(`/collections/${n}/records/${e}/unpublish`,{})}function fd(n,e){return _i(`/collections/${n}/records/${e}/lock`,{})}function Wx(n,e){return kh(`/collections/${n}/records/${e}/lock`)}function oa(n){if(!n)return"";try{return new Date(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return n}}function rc(n){if(n===0)return"0 B";const e=1024,t=["B","KB","MB","GB"],r=Math.floor(Math.log(n)/Math.log(e));return`${parseFloat((n/e**r).toFixed(1))} ${t[r]}`}function Rh(n,e=50){return!n||n.length<=e?n||"":`${n.slice(0,e)}...`}var Kx=M('<span class="text-sm"> </span>');function Ti(n,e){ce(e,!0);var t=Kx(),r=w(t);G((i,o)=>{re(t,"title",i),$(r,o)},[()=>String(e.value??""),()=>Rh(String(e.value??""),60)]),y(n,t),de()}function Hx(n,e){var t=te(),r=q(t);{var i=s=>{Th(s,{class:"h-4 w-4 text-green-600"})},o=s=>{or(s,{class:"h-4 w-4 text-muted-foreground"})};W(r,s=>{e.value?s(i):s(o,-1)})}y(n,t)}var Vx=M("<span> </span>"),Jx=M('<span class="text-sm text-muted-foreground">-</span>');function qx(n,e){ce(e,!0);let t=U(()=>e.fieldSchema?.name==="status"&&e.value==="published"&&e.record?.publishedAt&&new Date(e.record.publishedAt)>new Date),r=U(()=>l(t)?"bg-yellow-100 text-yellow-800":e.value==="published"?"bg-green-100 text-green-800":e.value==="draft"?"bg-gray-100 text-gray-800":e.value==="archived"?"bg-red-100 text-red-800":"border");var i=te(),o=q(i);{var s=u=>{var c=Vx(),d=w(c);G(()=>{be(c,1,`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${l(r)??""}`),$(d,l(t)?"Scheduled":e.value)}),y(u,c)},a=u=>{var c=Jx();y(u,c)};W(o,u=>{e.value?u(s):u(a,-1)})}y(n,i),de()}var Gx=M('<span class="text-sm text-muted-foreground"> </span>');function Yx(n,e){ce(e,!0);var t=Gx(),r=w(t);G(i=>$(r,i),[()=>e.value?oa(String(e.value)):"-"]),y(n,t),de()}var Zx=M('<div class="flex items-center gap-1.5"><span class="inline-block h-4 w-4 rounded border"></span> <span class="text-xs text-muted-foreground"> </span></div>'),Xx=M('<span class="text-sm text-muted-foreground">-</span>');function Qx(n,e){var t=te(),r=q(t);{var i=s=>{var a=Zx(),u=w(a),c=N(u,2),d=w(c);G(()=>{Qn(u,`background-color: ${e.value??""}`),$(d,e.value)}),y(s,a)},o=s=>{var a=Xx();y(s,a)};W(r,s=>{e.value?s(i):s(o,-1)})}y(n,t)}var $x=M('<span class="text-sm"> </span>');function e0(n,e){ce(e,!0);let t=U(()=>e.value?e.fieldSchema?.relationType==="manyToMany"?Array.isArray(e.value)?`${e.value.length} item${e.value.length!==1?"s":""}`:"-":typeof e.value=="object"&&e.value!==null?e.value.name||e.value.title||e.value.label||e.value.slug||e.value.id||"-":String(e.value):"-");var r=$x(),i=w(r);G(()=>$(i,l(t))),y(n,r),de()}var t0=M('<img alt="" class="h-8 w-8 rounded object-cover"/>'),n0=M('<span class="text-sm text-muted-foreground"> </span>');function gd(n,e){ce(e,!0);let t=U(()=>e.value?e.fieldSchema?.multiple?Array.isArray(e.value)?`${e.value.length} file${e.value.length!==1?"s":""}`:"-":typeof e.value=="object"&&e.value!==null&&e.value.filename||"-":"-"),r=U(()=>!e.value||typeof e.value!="object"||e.fieldSchema?.multiple?!1:e.value.mimeType?.startsWith("image/")),i=U(()=>!l(r)||typeof e.value!="object"?"":e.value.url||"");var o=te(),s=q(o);{var a=c=>{var d=t0();G(()=>re(d,"src",l(i))),y(c,d)},u=c=>{var d=n0(),f=w(d);G(()=>$(f,l(t))),y(c,d)};W(s,c=>{l(r)&&l(i)?c(a):c(u,-1)})}y(n,o),de()}var r0=M('<span class="text-sm"> </span>');function i0(n,e){ce(e,!0);function t(s){if(s==null)return"";if(typeof s=="string")return s;if(Array.isArray(s))return s.map(t).join(" ");if(typeof s=="object"){if(typeof s.text=="string")return s.text;if(Array.isArray(s.content))return s.content.map(t).join(" ")}return""}let r=U(()=>t(e.value).replace(/\s+/g," ").trim());var i=r0(),o=w(i);G(s=>{re(i,"title",l(r)),$(o,s)},[()=>Rh(l(r),60)||"-"]),y(n,i),de()}const Ts={text:Ti,textarea:Ti,slug:Ti,email:Ti,number:Ti,select:qx,checkbox:Hx,date:Yx,color:Qx,richtext:i0,relationship:e0,upload:gd,file:gd,json:Ti};var o0=M('<th class="px-4 py-3 text-left"><div class="group inline-flex items-center gap-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground"><span> </span> <span class="inline-flex flex-col leading-none -space-y-px"><button type="button"><!></button> <button type="button"><!></button></span></div></th>'),s0=M('<tr><td class="px-4 py-16 text-center"><div class="flex flex-col items-center gap-2"><div class="h-12 w-12 rounded-xl border-2 border-dashed border-border/80 flex items-center justify-center"><span class="text-lg text-muted-foreground/40">0</span></div> <p class="text-sm text-muted-foreground">No records found</p></div></td></tr>'),a0=M('<span class="font-medium text-foreground"><!></span>'),l0=M('<span class="text-muted-foreground"><!></span>'),u0=M('<td class="px-4 py-3"><!></td>'),c0=M('<tr class="cursor-pointer border-b border-border/40 transition-colors last:border-b-0 hover:bg-secondary/50"><!><td class="px-4 py-3 text-right"><button class="rounded-lg p-1.5 text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive" title="Delete"><!></button></td></tr>'),d0=M('<div class="overflow-x-auto rounded-xl border border-border/60 bg-card shadow-sm"><table class="w-full text-sm"><thead><tr class="border-b border-border/60"><!><th class="w-12 px-4 py-3 text-right text-xs font-semibold uppercase tracking-wider text-muted-foreground"></th></tr></thead><tbody><!></tbody></table></div>');function f0(n,e){ce(e,!0);let t=se(e,"sort",3,""),r=se(e,"columnNames",3,null);function i(k){const b=[];for(const C of k){if(C.type==="tabs"){for(const T of C.tabs??[])b.push(...i(T.fields??[]));continue}if(C.type==="row"){b.push(...i(C.fields??[]));continue}b.push(C)}return b}let o=U(()=>{const k=i(e.collection.fields),b=new Set(k.map(T=>T.name)),C=Fh.filter(T=>!b.has(T.name));return[...k,...C]}),s=U(()=>r()&&r().length?r().map(k=>l(o).find(b=>b.name===k)).filter(k=>k!==void 0):e.collection.admin?.defaultColumns?.length?e.collection.admin.defaultColumns.map(k=>l(o).find(b=>b.name===k)).filter(k=>k!==void 0):l(o).filter(k=>!k.hidden).slice(0,4)),a=U(()=>e.collection.admin?.useAsTitle||l(s)[0]?.name||"id"),u=U(()=>t().startsWith("-")?t().slice(1):t()),c=U(()=>t().startsWith("-")?"desc":"asc");function d(k,b){e.onSort(k==="asc"?b:`-${b}`)}var f=d0(),g=w(f),p=w(g),v=w(p),m=w(v);Re(m,17,()=>l(s),gt,(k,b)=>{const C=U(()=>l(u)===l(b).name&&l(c)==="asc"),T=U(()=>l(u)===l(b).name&&l(c)==="desc");var O=o0(),E=w(O),D=w(E),L=w(D),V=N(D,2),J=w(V),R=w(J);$u(R,{class:"h-3 w-3 stroke-[2.5]"});var P=N(J,2),K=w(P);ls(K,{class:"h-3 w-3 stroke-[2.5]"}),G(()=>{$(L,l(b).label),re(J,"aria-label",`Sort ${l(b).label??""} ascending`),be(J,1,`flex h-2 items-end transition-opacity hover:opacity-100 ${l(C)?"opacity-100 text-primary":"opacity-20 group-hover:opacity-50"}`),re(P,"aria-label",`Sort ${l(b).label??""} descending`),be(P,1,`flex h-2 items-start transition-opacity hover:opacity-100 ${l(T)?"opacity-100 text-primary":"opacity-20 group-hover:opacity-50"}`)}),Z("click",J,()=>d("asc",l(b).name)),Z("click",P,()=>d("desc",l(b).name)),y(k,O)});var h=N(p),x=w(h);{var _=k=>{var b=s0(),C=w(b);G(()=>re(C,"colspan",l(s).length+1)),y(k,b)},S=k=>{var b=te(),C=q(b);Re(C,19,()=>e.records,T=>T.id,(T,O)=>{var E=c0(),D=w(E);Re(D,17,()=>l(s),gt,(R,P)=>{var K=u0(),Q=w(K);{var ee=j=>{var ne=a0(),B=w(ne);{var z=I=>{const Y=U(()=>Ts[l(P).type]);var ie=te(),ue=q(ie);Vt(ue,()=>l(Y),(we,me)=>{me(we,{get value(){return l(O)[l(P).name]},get fieldSchema(){return l(P)},get record(){return l(O)}})}),y(I,ie)},F=I=>{var Y=xr();G(()=>$(Y,l(O)[l(P).name]??"-")),y(I,Y)};W(B,I=>{Ts[l(P).type]?I(z):I(F,-1)})}y(j,ne)},H=j=>{var ne=l0(),B=w(ne);{var z=I=>{const Y=U(()=>Ts[l(P).type]);var ie=te(),ue=q(ie);Vt(ue,()=>l(Y),(we,me)=>{me(we,{get value(){return l(O)[l(P).name]},get fieldSchema(){return l(P)},get record(){return l(O)}})}),y(I,ie)},F=I=>{var Y=xr();G(()=>$(Y,l(O)[l(P).name]??"-")),y(I,Y)};W(B,I=>{Ts[l(P).type]?I(z):I(F,-1)})}y(j,ne)};W(Q,j=>{l(P).name===l(a)?j(ee):j(H,-1)})}y(R,K)});var L=N(D),V=w(L),J=w(V);Mh(J,{class:"h-3.5 w-3.5"}),Z("click",E,()=>Tn(Je(`/${e.collection.key}/${l(O).id}`))),Z("click",V,R=>{R.stopPropagation(),e.onDelete(l(O).id)}),y(T,E)}),y(k,b)};W(x,k=>{e.records.length===0?k(_):k(S,-1)})}y(n,f),de()}ve(["click"]);var g0=M('<div class="rounded-lg border border-dashed border-border/60 bg-card py-16 text-center text-sm text-muted-foreground">No records yet</div>'),h0=M('<img class="h-full w-full object-cover transition-transform group-hover:scale-105" loading="lazy"/>'),v0=M('<div class="flex h-full w-full items-center justify-center"><!></div>'),p0=M('<div class="group relative flex flex-col overflow-hidden rounded-lg border border-border/80 bg-card text-left shadow-sm transition-all hover:border-primary/40 hover:shadow-md"><a class="flex flex-col"><div class="relative aspect-square w-full overflow-hidden bg-muted"><!></div> <div class="px-3 py-2"><p class="truncate text-xs font-medium text-foreground"> </p></div></a> <button type="button" class="absolute right-2 top-2 inline-flex h-7 w-7 items-center justify-center rounded-md bg-background/90 text-destructive opacity-0 shadow-sm backdrop-blur transition-opacity hover:bg-destructive hover:text-white group-hover:opacity-100" title="Delete"><!></button></div>'),m0=M('<div class="grid gap-3" style="grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));"></div>');function _0(n,e){ce(e,!0);function t(v){const m=[];for(const h of v){if(h.type==="tabs"){for(const x of h.tabs??[])m.push(...t(x.fields??[]));continue}if(h.type==="row"){m.push(...t(h.fields??[]));continue}m.push(h)}return m}let r=U(()=>t(e.collection.fields)),i=U(()=>l(r).find(v=>v.type==="file"||v.type==="upload")),o=U(()=>e.collection.admin?.useAsTitle||l(r)[0]?.name||"id");function s(v){if(!v)return null;let m=v;if(typeof m=="string")if(m.startsWith("{"))try{m=JSON.parse(m)}catch{return null}else return{url:m};return typeof m=="object"&&m!==null?m:null}function a(v){if(typeof v.url=="string"&&v.url){const h=typeof v.mimeType=="string"?v.mimeType:"";return h&&!h.startsWith("image/")?null:v.url}if(!l(i))return null;const m=s(v[l(i).name]);return!m?.url||m.mimeType&&!m.mimeType.startsWith("image/")?null:m.url}function u(v){const m=v[l(o)];return m&&typeof m=="string"?m:m&&typeof m=="object"&&"filename"in m?m.filename:v.id||"Untitled"}function c(v,m){v.stopPropagation(),e.onDelete(m)}var d=te(),f=q(d);{var g=v=>{var m=g0();y(v,m)},p=v=>{var m=m0();Re(m,21,()=>e.records,h=>h.id,(h,x)=>{const _=U(()=>a(l(x))),S=U(()=>u(l(x)));var k=p0(),b=w(k),C=w(b),T=w(C);{var O=P=>{var K=h0();G(()=>{re(K,"src",l(_)),re(K,"alt",l(S))}),y(P,K)},E=P=>{var K=v0(),Q=w(K);ec(Q,{class:"h-10 w-10 text-muted-foreground/40"}),y(P,K)};W(T,P=>{l(_)?P(O):P(E,-1)})}var D=N(C,2),L=w(D),V=w(L),J=N(b,2),R=w(J);Mh(R,{class:"h-3.5 w-3.5"}),G(P=>{re(b,"href",P),$(V,l(S))},[()=>Je(`/${e.collection.key}/${l(x).id}`)]),Z("click",J,P=>c(P,l(x).id)),y(h,k)}),y(v,m)};W(f,v=>{e.records.length===0?v(g):v(p,-1)})}y(n,d),de()}ve(["click"]);var b0=M('<span class="px-1 text-xs text-muted-foreground/50">...</span>'),y0=M("<button> </button>"),x0=M('<div><p class="text-[13px] text-muted-foreground"><span class="font-medium text-foreground"> </span> </p> <div class="flex items-center gap-1.5"><button class="inline-flex h-8 w-8 items-center justify-center rounded-lg border border-border/60 bg-card text-sm shadow-sm transition-all hover:bg-secondary disabled:opacity-40 disabled:shadow-none"><!></button> <!> <button class="inline-flex h-8 w-8 items-center justify-center rounded-lg border border-border/60 bg-card text-sm shadow-sm transition-all hover:bg-secondary disabled:opacity-40 disabled:shadow-none"><!></button></div></div>');function sa(n,e){ce(e,!0);let t=se(e,"page",3,1),r=se(e,"totalPages",3,1),i=se(e,"totalRecords",3,0),o=se(e,"perPage",3,20),s=se(e,"class",3,"border-t border-border/60"),a=U(()=>(t()-1)*o()+1),u=U(()=>Math.min(t()*o(),i()));var c=te(),d=q(c);{var f=g=>{var p=x0(),v=w(p),m=w(v),h=w(m),x=N(m),_=N(v,2),S=w(_),k=w(S);dy(k,{class:"h-4 w-4"});var b=N(S,2);Re(b,17,()=>Array.from({length:Math.min(r(),7)},(O,E)=>r()<=7?E+1:E===0?1:E===6?r():t()<=3?E===5?-1:E+1:t()>=r()-2?E===1?-1:r()-5+E:E===1||E===5?-1:t()-3+E),gt,(O,E)=>{var D=te(),L=q(D);{var V=R=>{var P=b0();y(R,P)},J=R=>{var P=y0(),K=w(P);G(()=>{be(P,1,`inline-flex h-8 w-8 items-center justify-center rounded-lg text-[13px] transition-all
|
|
6
|
-
${l(E)===t()?"bg-primary font-medium text-primary-foreground shadow-sm":"border border-border/60 bg-card shadow-sm hover:bg-secondary"}`),$(K,l(E))}),Z("click",P,()=>e.onPageChange(l(E))),y(R,P)};W(L,R=>{l(E)===-1?R(V):R(J,-1)})}y(O,D)});var C=N(b,2),T=w(C);Qu(T,{class:"h-4 w-4"}),G(()=>{be(p,1,`flex items-center justify-between px-1 py-3 ${s()??""}`),$(h,`${l(a)??""}-${l(u)??""}`),$(x,` of ${i()??""}`),S.disabled=t()<=1,C.disabled=t()>=r()}),Z("click",S,()=>e.onPageChange(t()-1)),Z("click",C,()=>e.onPageChange(t()+1)),y(g,p)};W(d,g=>{r()>1&&g(f)})}y(n,c),de()}ve(["click"]);var w0=M('<div class="fixed inset-0 z-50 flex items-center justify-center"><div class="fixed inset-0 bg-black/40 backdrop-blur-[2px]"></div> <div class="relative z-10 w-full max-w-md rounded-xl border border-border/60 bg-card p-6 shadow-lg"><div class="flex items-start gap-4"><div class="flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-destructive/10"><!></div> <div><h3 class="font-semibold" style="font-family: var(--font-display);"> </h3> <p class="mt-1.5 text-sm leading-relaxed text-muted-foreground"> </p></div></div> <div class="mt-6 flex justify-end gap-2.5"><button class="h-9 rounded-lg border border-border/60 bg-card px-4 text-sm font-medium shadow-sm transition-all hover:bg-secondary">Cancel</button> <button class="h-9 rounded-lg bg-destructive px-4 text-sm font-medium text-destructive-foreground shadow-sm transition-all hover:bg-destructive/90 disabled:opacity-50"> </button></div></div></div>');function zh(n,e){ce(e,!0);let t=se(e,"open",15,!1),r=se(e,"title",3,"Confirm Delete"),i=se(e,"description",3,"Are you sure? This action cannot be undone."),o=se(e,"isDeleting",3,!1);var s=te(),a=q(s);{var u=c=>{var d=w0(),f=w(d),g=N(f,2),p=w(g),v=w(p),m=w(v);qy(m,{class:"h-5 w-5 text-destructive"});var h=N(v,2),x=w(h),_=w(x),S=N(x,2),k=w(S),b=N(p,2),C=w(b),T=N(C,2),O=w(T);G(()=>{$(_,r()),$(k,i()),C.disabled=o(),T.disabled=o(),$(O,o()?"Deleting...":"Delete")}),Z("keydown",d,E=>E.key==="Escape"&&t(!1)),Z("click",f,()=>t(!1)),Z("click",C,()=>t(!1)),Z("click",T,function(...E){e.onConfirm?.apply(this,E)}),y(c,d)};W(a,c=>{t()&&c(u)})}y(n,s),de()}ve(["keydown","click"]);var S0=M('<div class="flex h-full items-center justify-center"><p class="text-muted-foreground">Collection not found</p></div>'),k0=M('<div class="inline-flex items-center gap-0.5 rounded-lg border border-border/80 bg-card p-0.5 shadow-sm"><button type="button" title="List view"><!></button> <button type="button" title="Grid view"><!></button></div>'),C0=M('<button type="button" class="rounded p-0.5 text-muted-foreground hover:bg-muted disabled:opacity-30" title="Move up"><!></button> <button type="button" class="rounded p-0.5 text-muted-foreground hover:bg-muted disabled:opacity-30" title="Move down"><!></button>',1),E0=M('<div class="flex items-center gap-1 rounded px-1 py-0.5 hover:bg-secondary"><label class="flex flex-1 cursor-pointer items-center gap-2 px-1 py-1 text-sm"><input type="checkbox"/> <span> </span></label> <!></div>'),T0=M('<div class="absolute right-0 z-20 mt-2 w-56 rounded-lg border border-border/80 bg-card p-2 shadow-lg" role="menu"></div>'),N0=M('<a href="/api/subscribers/export.csv" download="" class="inline-flex items-center gap-2 rounded-lg bg-brand-red px-3 py-2 text-sm font-medium text-white shadow-sm transition-colors hover:opacity-90"><!> Export CSV</a>'),A0=M('<div class="flex justify-center py-16"><div class="flex flex-col items-center gap-3"><div class="h-6 w-6 rounded-full border-2 border-primary/20 border-t-primary animate-spin-slow"></div> <p class="text-sm text-muted-foreground">Loading...</p></div></div>'),O0=M('<div class="space-y-5"><div class="flex items-center justify-between gap-3"><div class="relative w-full max-w-sm"><!> <input type="text" class="h-10 w-full rounded-lg border border-border/80 bg-card pl-10 pr-4 text-sm shadow-sm transition-all placeholder:text-muted-foreground/50 focus:border-primary/40 focus:outline-none focus:ring-2 focus:ring-primary/10"/></div> <!> <div class="relative"><button type="button" class="inline-flex items-center gap-2 rounded-lg border border-border/80 bg-card px-3 py-2 text-sm font-medium text-foreground shadow-sm transition-colors hover:bg-secondary"><!> Columns</button> <!></div> <!></div> <!> <!> <!></div> <!>',1);function M0(n,e){ce(e,!0);let t=U(()=>pn.params.collection??""),r=U(()=>po(en.collections,l(t))),i=X(Be([])),o=X(1),s=X(1),a=X(0),u=20,c=X(""),d=X(""),f=X(!1),g=X(!1),p=X(""),v=X(!1),m,h=X(null),x=X(null),_=X(!1),S=X(null);function k(F){l(_)&&l(S)&&!l(S).contains(F.target)&&A(_,!1)}nt(()=>{if(!l(_))return;const F=setTimeout(()=>{document.addEventListener("mousedown",k)},0);return()=>{clearTimeout(F),document.removeEventListener("mousedown",k)}});let b=X("list");function C(F){return O(F).some(I=>I.type==="file"||I.type==="upload")}nt(()=>{if(l(r)){if(typeof localStorage<"u"){const F=localStorage.getItem(`view:${l(t)}`);if(F==="grid"||F==="list"){A(b,F,!0);return}}A(b,l(t)==="media"?"grid":"list",!0)}});function T(F){A(b,F,!0),typeof localStorage<"u"&&localStorage.setItem(`view:${l(t)}`,F)}function O(F){const I=[];for(const Y of F){if(Y.type==="tabs"){for(const ie of Y.tabs??[])I.push(...O(ie.fields??[]));continue}I.push(Y)}return I}let E=U(()=>{if(!l(r))return[];const F=O(l(r).fields).filter(ie=>!ie.hidden),I=new Set(F.map(ie=>ie.name)),Y=Fh.filter(ie=>!I.has(ie.name));return[...F,...Y]});nt(()=>{if(!l(r)||l(x)===l(t))return;A(o,1),A(d,""),A(c,"");let F=null;const I=typeof localStorage<"u"?localStorage.getItem(`cols:${l(t)}`):null;if(I)try{F=JSON.parse(I)}catch{F=null}(!F||!F.length)&&(F=l(r).admin?.defaultColumns?.length?[...l(r).admin.defaultColumns]:O(l(r).fields).filter(Y=>!Y.hidden).slice(0,4).map(Y=>Y.name)),A(h,Array.from(new Set(F)),!0),A(x,l(t),!0)});function D(F){A(h,F,!0),typeof localStorage<"u"&&localStorage.setItem(`cols:${l(t)}`,JSON.stringify(F))}function L(F){const I=l(h)??[];D(I.includes(F)?I.filter(Y=>Y!==F):[...I,F])}function V(F,I){const Y=[...l(h)??[]],ie=Y.indexOf(F);if(ie<0)return;const ue=ie+I;ue<0||ue>=Y.length||([Y[ie],Y[ue]]=[Y[ue],Y[ie]],D(Y))}let J=U(()=>{const F=new Set,I=[];for(const ie of l(h)??[]){if(F.has(ie))continue;const ue=l(E).find(we=>we.name===ie);ue&&(F.add(ie),I.push(ue))}const Y=l(E).filter(ie=>!F.has(ie.name));return[...I,...Y]});nt(()=>{l(r)&&R()});async function R(){if(!l(r))return;A(f,!0);const F=l(r).admin?.defaultSort||"-createdAt",I=l(r).fields.filter(ie=>ie.type==="relationship").map(ie=>ie.name),Y=await Vo(l(t),{page:l(o),perPage:u,sort:l(c)||F,search:l(d)||void 0,expand:I.length?I.join(","):void 0});A(f,!1),Y.ok?(A(i,Y.data.records,!0),A(s,Y.data.totalPages,!0),A(a,Y.data.totalRecords,!0)):ze.error(Y.error)}function P(F){const I=F.target;A(d,I.value,!0),clearTimeout(m),m=setTimeout(()=>{A(o,1),R()},300)}function K(F){A(c,F,!0),A(o,1),R()}function Q(F){A(o,F,!0),R()}function ee(F){A(p,F,!0),A(g,!0)}async function H(){A(v,!0);const F=await Lh(l(t),l(p));A(v,!1),A(g,!1),F.ok?(ze.success("Record deleted"),await R()):ze.error(F.error)}var j=te(),ne=q(j);{var B=F=>{var I=S0();y(F,I)},z=F=>{var I=O0(),Y=q(I),ie=w(Y),ue=w(ie),we=w(ue);nc(we,{class:"absolute left-3.5 top-3 h-4 w-4 text-muted-foreground/60"});var me=N(we,2),ge=N(ue,2);{var Te=Me=>{var wt=k0(),Pt=w(wt),Ve=w(Pt);Ah(Ve,{class:"h-4 w-4"});var lt=N(Pt,2),ot=w(lt);Cy(ot,{class:"h-4 w-4"}),G(()=>{be(Pt,1,`inline-flex h-8 w-8 items-center justify-center rounded-md transition-colors ${l(b)==="list"?"bg-secondary text-foreground":"text-muted-foreground hover:bg-secondary/60"}`),be(lt,1,`inline-flex h-8 w-8 items-center justify-center rounded-md transition-colors ${l(b)==="grid"?"bg-secondary text-foreground":"text-muted-foreground hover:bg-secondary/60"}`)}),Z("click",Pt,()=>T("list")),Z("click",lt,()=>T("grid")),y(Me,wt)},Ne=U(()=>C(l(r).fields));W(ge,Me=>{l(Ne)&&Me(Te)})}var Oe=N(ge,2),he=w(Oe),et=w(he);hy(et,{class:"h-4 w-4"});var Ye=N(he,2);{var Ct=Me=>{var wt=T0();Re(wt,23,()=>l(J),Pt=>Pt.name,(Pt,Ve)=>{const lt=U(()=>(l(h)??[]).includes(l(Ve).name)),ot=U(()=>(l(h)??[]).indexOf(l(Ve).name));var Ze=E0(),dt=w(Ze),Ie=w(dt),qe=N(Ie,2),De=w(qe),ut=N(dt,2);{var Nt=mt=>{var Ge=C0(),Xe=q(Ge),Kt=w(Xe);$u(Kt,{class:"h-3.5 w-3.5"});var St=N(Xe,2),gn=w(St);ls(gn,{class:"h-3.5 w-3.5"}),G(()=>{Xe.disabled=l(ot)<=0,St.disabled=l(ot)>=(l(h)??[]).length-1}),Z("click",Xe,()=>V(l(Ve).name,-1)),Z("click",St,()=>V(l(Ve).name,1)),y(mt,Ge)};W(ut,mt=>{l(lt)&&mt(Nt)})}G(()=>{B_(Ie,l(lt)),$(De,l(Ve).label??l(Ve).name)}),Z("change",Ie,()=>L(l(Ve).name)),y(Pt,Ze)}),y(Me,wt)};W(Ye,Me=>{l(_)&&Me(Ct)})}_n(Oe,Me=>A(S,Me),()=>l(S));var Tt=N(Oe,2);{var Fe=Me=>{var wt=N0(),Pt=w(wt);py(Pt,{class:"h-4 w-4"}),y(Me,wt)};W(Tt,Me=>{l(t)==="subscribers"&&Me(Fe)})}var tt=N(ie,2);sa(tt,{get page(){return l(o)},get totalPages(){return l(s)},get totalRecords(){return l(a)},perPage:u,onPageChange:Q,class:"border-b border-border/60"});var ye=N(tt,2);{var Ce=Me=>{var wt=A0();y(Me,wt)},Pe=Me=>{_0(Me,{get collection(){return l(r)},get records(){return l(i)},onDelete:ee})},Le=Me=>{f0(Me,{get collection(){return l(r)},get records(){return l(i)},get sort(){return l(c)},get columnNames(){return l(h)},onSort:K,onDelete:ee})};W(ye,Me=>{l(f)?Me(Ce):l(b)==="grid"?Me(Pe,1):Me(Le,-1)})}var Ke=N(ye,2);sa(Ke,{get page(){return l(o)},get totalPages(){return l(s)},get totalRecords(){return l(a)},perPage:u,onPageChange:Q});var je=N(Y,2);zh(je,{title:"Delete Record",description:"Are you sure you want to delete this record? This action cannot be undone.",get isDeleting(){return l(v)},onConfirm:H,get open(){return l(g)},set open(Me){A(g,Me,!0)}}),G(()=>{ir(me,l(d)),re(me,"placeholder",`Search ${(l(r).labelPlural||l(r).label)??""}...`)}),Z("input",me,P),Z("click",he,()=>A(_,!l(_))),y(F,I)};W(ne,F=>{l(r)?F(z,-1):F(B)})}y(n,j),de()}ve(["input","click","change"]);var P0=M('<span class="inline-flex items-center gap-1.5 text-[11px] text-amber-700"><span class="h-1.5 w-1.5 rounded-full bg-amber-600"></span> Unsaved</span>'),D0=M('<span class="text-primary">●</span>'),F0=M('<span class="text-primary">●</span>'),I0=M('<button type="button" class="flex w-full items-center justify-between px-3 py-2 text-left text-xs text-foreground hover:bg-secondary">Schedule Publish</button>'),L0=M('<span class="text-primary">●</span>'),R0=M('<div class="absolute right-0 z-20 mt-1 w-44 overflow-hidden rounded-lg border border-border bg-card shadow-lg"><button type="button" class="flex w-full items-center justify-between px-3 py-2 text-left text-xs text-foreground hover:bg-secondary">Save as draft <!></button> <button type="button" class="flex w-full items-center justify-between px-3 py-2 text-left text-xs text-foreground hover:bg-secondary">Publish <!></button> <!> <button type="button" class="flex w-full items-center justify-between px-3 py-2 text-left text-xs text-foreground hover:bg-secondary">Archive <!></button></div>'),z0=M('<div class="inline-flex items-center gap-2"><!> <div class="relative"><div class="inline-flex items-stretch overflow-hidden rounded-lg shadow-sm"><button type="button" class="bg-primary px-4 py-2 text-xs font-semibold tracking-wide text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-60"> </button> <button type="button" class="flex items-center border-l border-primary-foreground/15 bg-primary/90 px-2 text-primary-foreground hover:bg-primary disabled:opacity-60" aria-label="Publish options"><!></button></div> <!></div></div>');function B0(n,e){ce(e,!0);let t=se(e,"isSubmitting",3,!1),r=se(e,"isDirty",3,!1),i=se(e,"disabled",3,!1),o=se(e,"hasSchedulePublish",3,!1),s=X(!1),a=X(null);function u(){A(s,!l(s))}function c(C){A(s,!1),e.onSaveAs(C)}function d(C){l(s)&&l(a)&&!l(a).contains(C.target)&&A(s,!1)}var f=z0();Bn("click",jo,d);var g=w(f);{var p=C=>{var T=P0();y(C,T)};W(g,C=>{r()&&C(p)})}var v=N(g,2),m=w(v),h=w(m),x=w(h),_=N(h,2),S=w(_);ls(S,{class:"h-3.5 w-3.5"});var k=N(m,2);{var b=C=>{var T=R0(),O=w(T),E=N(w(O));{var D=H=>{var j=D0();y(H,j)};W(E,H=>{e.currentStatus==="draft"&&H(D)})}var L=N(O,2),V=N(w(L));{var J=H=>{var j=F0();y(H,j)};W(V,H=>{e.currentStatus==="published"&&H(J)})}var R=N(L,2);{var P=H=>{var j=I0();Z("click",j,()=>{A(s,!1),e.onSchedule?.()}),y(H,j)};W(R,H=>{o()&&e.onSchedule&&H(P)})}var K=N(R,2),Q=N(w(K));{var ee=H=>{var j=L0();y(H,j)};W(Q,H=>{e.currentStatus==="archived"&&H(ee)})}Z("click",O,()=>c("draft")),Z("click",L,()=>c("published")),Z("click",K,()=>c("archived")),y(C,T)};W(k,C=>{l(s)&&C(b)})}_n(v,C=>A(a,C),()=>l(a)),G(()=>{h.disabled=i()||t(),$(x,t()?"Saving…":e.label),_.disabled=i()||t(),re(_,"aria-expanded",l(s))}),Z("click",h,function(...C){e.onSave?.apply(this,C)}),Z("click",_,u),y(n,f),de()}ve(["click"]);var U0=M('<span class="flex items-center gap-2"><span class="text-[11px] uppercase tracking-wider text-stone-400">Status:</span> <span><span class="h-1.5 w-1.5 rounded-full bg-current opacity-70"></span> </span></span>'),j0=M('<span><span class="text-stone-400">Last Modified:</span> <span class="ml-1.5 font-medium text-stone-700"> </span></span>'),W0=M('<span><span class="text-stone-400">Created:</span> <span class="ml-1.5 font-medium text-stone-700"> </span></span>'),K0=M("<!> <!>",1),H0=M('<button type="button" class="rounded-lg border border-border px-3 py-1.5 text-xs font-medium text-muted-foreground hover:bg-secondary hover:text-foreground transition-colors">Unpublish</button>'),V0=M('<div class="flex flex-wrap items-center justify-between gap-4 px-7 pb-4 pt-3.5"><div class="flex flex-wrap items-center gap-5 text-xs text-muted-foreground"><!> <!> <!></div> <div class="flex items-center gap-2"><!> <button type="button" disabled="" class="flex h-9 w-9 items-center justify-center rounded-lg border border-border bg-card text-stone-500 opacity-50 shadow-sm" title="Open in new tab (coming soon)"><!></button> <!> <button type="button" disabled="" class="flex h-9 w-9 items-center justify-center rounded-lg border border-border bg-card text-stone-500 opacity-50 shadow-sm" title="More actions (coming soon)"><!></button></div></div>');function J0(n,e){ce(e,!0);let t=se(e,"hasDrafts",3,!1),r=se(e,"hasSchedulePublish",3,!1);const i={draft:"bg-amber-100 text-amber-800 border border-amber-200",published:"bg-emerald-100 text-emerald-800 border border-emerald-200",archived:"bg-stone-200 text-stone-700 border border-stone-300",scheduled:"bg-yellow-100 text-yellow-800 border border-yellow-200"};let o=U(()=>i[e.status?.toLowerCase()]??"bg-stone-100 text-stone-700 border border-stone-200"),s=U(()=>e.status?e.status.charAt(0).toUpperCase()+e.status.slice(1):"—");var a=V0(),u=w(a),c=w(u);{var d=T=>{var O=U0(),E=N(w(O),2),D=N(w(E));G(()=>{be(E,1,`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-[11px] font-semibold ${l(o)??""}`),$(D,` ${l(s)??""}`)}),y(T,O)};W(c,T=>{t()&&T(d)})}var f=N(c,2);{var g=T=>{var O=K0(),E=q(O);{var D=J=>{var R=j0(),P=N(w(R),2),K=w(P);G(Q=>$(K,Q),[()=>oa(e.record.updatedAt)]),y(J,R)};W(E,J=>{e.record.updatedAt&&J(D)})}var L=N(E,2);{var V=J=>{var R=W0(),P=N(w(R),2),K=w(P);G(Q=>$(K,Q),[()=>oa(e.record.createdAt)]),y(J,R)};W(L,J=>{e.record.createdAt&&J(V)})}y(T,O)};W(f,T=>{e.mode==="edit"&&e.record&&T(g)})}var p=N(f,2);{var v=T=>{var O=te(),E=q(O);Dt(E,()=>e.metaExtra),y(T,O)};W(p,T=>{e.metaExtra&&T(v)})}var m=N(u,2),h=w(m);{var x=T=>{var O=H0();Z("click",O,function(...E){e.onUnpublish?.apply(this,E)}),y(T,O)};W(h,T=>{t()&&e.status==="published"&&e.mode!=="create"&&e.onUnpublish&&T(x)})}var _=N(h,2),S=w(_);_y(S,{class:"h-4 w-4"});var k=N(_,2);B0(k,{get label(){return e.saveLabel},get currentStatus(){return e.status},get isSubmitting(){return e.isSubmitting},get isDirty(){return e.isDirty},get hasSchedulePublish(){return r()},get onSave(){return e.onSave},get onSaveAs(){return e.onSaveAs},get onSchedule(){return e.onSchedule}});var b=N(k,2),C=w(b);my(C,{class:"h-4 w-4"}),y(n,a),de()}ve(["click"]);var q0=M('<button type="button"> </button>'),G0=M('<div class="flex gap-0.5 border-b border-border px-7"></div>');function Y0(n,e){ce(e,!0);let t=se(e,"activeIndex",15,0);var r=te(),i=q(r);{var o=s=>{var a=G0();Re(a,21,()=>e.tabs,gt,(u,c,d)=>{var f=q0(),g=w(f);G(()=>{be(f,1,`-mb-px border-b-2 px-4 py-3 text-[13px] font-medium transition-colors
|
|
7
|
-
${t()===d?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"}`),$(g,l(c).label)}),Z("click",f,()=>t(d)),y(u,f)}),y(s,a)};W(i,s=>{e.tabs.length>0&&s(o)})}y(n,r),de()}ve(["click"]);var Z0=M('<div class="inline-flex items-stretch overflow-hidden rounded-lg border border-border bg-card shadow-sm"><button type="button">Edit</button> <button type="button">API</button></div>');function X0(n,e){ce(e,!0);var t=Z0(),r=w(t),i=N(r,2);G(()=>{be(r,1,`px-3 py-1.5 text-xs font-medium transition-colors
|
|
8
|
-
${e.mode==="edit"?"bg-primary text-primary-foreground":"text-stone-600 hover:bg-secondary"}`),be(i,1,`border-l border-border px-3 py-1.5 text-xs font-medium transition-colors
|
|
9
|
-
${e.mode==="api"?"bg-primary text-primary-foreground":"text-stone-600 hover:bg-secondary"}`)}),Z("click",r,()=>e.setMode("edit")),Z("click",i,()=>e.setMode("api")),y(n,t),de()}ve(["click"]);var Q0=M('<a class="inline-flex items-center gap-1.5 rounded-lg border border-border/80 px-3 py-1.5 text-xs font-medium text-muted-foreground hover:bg-muted hover:text-foreground transition-colors">Versions</a>'),$0=M('<header class="sticky top-0 z-10 border-b border-border bg-background"><div class="flex items-center justify-between border-b border-stone-200/60 px-7 py-3.5"><div class="flex min-w-0 items-center gap-2.5 text-[13px] text-muted-foreground"><a class="font-medium hover:text-foreground"> </a> <span class="text-stone-300">/</span> <span class="truncate font-medium text-foreground"> </span></div> <!> <!></div> <div class="px-7 pb-2 pt-5"><h1 class="font-display text-[28px] font-semibold leading-tight tracking-tight text-foreground"> </h1></div> <!> <!></header>');function e1(n,e){ce(e,!0);let t=se(e,"activeTab",15,0),r=se(e,"hasDrafts",3,!1),i=se(e,"hasSchedulePublish",3,!1);var o=$0(),s=w(o),a=w(s),u=w(a),c=w(u),d=N(u,4),f=w(d),g=N(a,2);{var p=b=>{var C=Q0();G(T=>re(C,"href",T),[()=>Je(`/${e.collection.key}/${e.record.id}/versions`)]),y(b,C)};W(g,b=>{e.collection.versions&&e.record?.id&&b(p)})}var v=N(g,2);X0(v,{get mode(){return e.headerMode},get setMode(){return e.setHeaderMode}});var m=N(s,2),h=w(m),x=w(h),_=N(m,2);J0(_,{get record(){return e.record},get mode(){return e.mode},get status(){return e.status},get saveLabel(){return e.saveLabel},get isDirty(){return e.isDirty},get isSubmitting(){return e.isSubmitting},get hasDrafts(){return r()},get hasSchedulePublish(){return i()},get onSave(){return e.onSave},get onSaveAs(){return e.onSaveAs},get onUnpublish(){return e.onUnpublish},get onSchedule(){return e.onSchedule},get metaExtra(){return e.metaExtra}});var S=N(_,2);{var k=b=>{Y0(b,{get tabs(){return e.tabs},get activeIndex(){return t()},set activeIndex(C){t(C)}})};W(S,b=>{e.headerMode==="edit"&&b(k)})}G(b=>{re(u,"href",b),$(c,e.collection.labelPlural||e.collection.label),$(f,e.liveTitle),$(x,e.liveTitle)},[()=>Je(`/${e.collection.key}`)]),y(n,o),de()}var t1=M('<span class="text-[11px] text-muted-foreground"> </span>');function n1(n,e){ce(e,!0);let t=se(e,"interval",3,2e3),r=X(null),i=X(!1),o=!1;function s(h){const{updatedAt:x,createdAt:_,_versionId:S,_versionCreatedAt:k,...b}=h;return JSON.stringify(b)}let a=s(e.formData),u,c=null;async function d(){for(;c;){const h=c;c=null,await h()}}function f(h){c=h,l(i)||d()}nt(()=>{const h=s(e.formData);if(!o){o=!0;return}h!==a&&e.recordId&&(u&&clearTimeout(u),u=setTimeout(()=>{const x=s(e.formData);x!==a&&(a=x,f(async()=>{A(i,!0);const _=await Ih(e.collectionKey,e.recordId,e.formData,{draft:!0,autosave:!0});A(i,!1),_.ok&&A(r,new Date,!0)}))},t()))});let g=U(()=>{if(!l(r))return"";const h=Math.floor((Date.now()-l(r).getTime())/1e3);return h<5?"just now":h<60?`${h}s ago`:`${Math.floor(h/60)}m ago`});var p=te(),v=q(p);{var m=h=>{var x=t1(),_=w(x);G(()=>$(_,l(i)?"Saving...":`Autosaved ${l(g)}`)),y(h,x)};W(v,h=>{l(r)&&h(m)})}y(n,p),de()}const r1={"&":"&","<":"<",">":">",'"':""","'":"'"};function i1(n){return n.replace(/[&<>"']/g,e=>r1[e])}function hd(n){const e=/("(?:\\.|[^"\\])*"\s*:?)|\b(true|false|null)\b|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)/g;return i1(n).replace(e,r=>r.startsWith('"')?r.trimEnd().endsWith(":")?`<span class="text-amber-700">${r}</span>`:`<span class="text-emerald-700">${r}</span>`:r==="true"||r==="false"?`<span class="text-blue-700">${r}</span>`:r==="null"?`<span class="text-stone-500">${r}</span>`:`<span class="text-violet-700">${r}</span>`)}var o1=M('<button type="button" class="inline-flex items-center gap-1.5 rounded-md border border-border bg-card px-2.5 py-1.5 text-xs text-foreground shadow-sm hover:bg-secondary"><!> Edit JSON</button>'),s1=M("<!> Copied",1),a1=M("<!> Copy",1),l1=M('<p class="text-xs text-destructive"> </p>'),u1=M('<textarea spellcheck="false" class="block min-h-[420px] w-full rounded-lg border border-border bg-card px-4 py-3 font-mono text-[12px] leading-relaxed text-foreground shadow-sm focus:border-primary/40 focus:outline-none focus:ring-2 focus:ring-primary/10"></textarea> <!> <div class="flex items-center gap-2"><button type="button" class="rounded-lg bg-primary px-4 py-2 text-xs font-semibold text-primary-foreground shadow-sm hover:bg-primary/90 disabled:opacity-50">Apply changes</button> <button type="button" class="rounded-lg border border-border bg-card px-4 py-2 text-xs text-foreground hover:bg-secondary">Cancel</button></div>',1),c1=M('<pre class="overflow-auto rounded-lg border border-border bg-card p-4 font-mono text-[12px] leading-relaxed text-foreground shadow-sm"></pre>'),d1=M('<pre class="overflow-auto rounded-lg border border-border bg-card p-4 font-mono text-[12px] leading-relaxed text-foreground shadow-sm"></pre>'),f1=M('<div class="space-y-4 px-7 py-6"><div class="flex items-center justify-between"><div class="flex gap-1"><button type="button">JSON</button> <button type="button">cURL</button></div> <div class="flex items-center gap-2"><!> <button type="button" class="inline-flex items-center gap-1.5 rounded-md border border-border bg-card px-2.5 py-1.5 text-xs text-foreground shadow-sm hover:bg-secondary"><!></button></div></div> <!></div>');function g1(n,e){ce(e,!0);let t=se(e,"formData",31,()=>Be({})),r=se(e,"recordId",3,null),i=X("json"),o=X(!1),s=X(""),a=X(null),u=null,c=X(!1),d=U(()=>JSON.stringify(t(),null,2)),f=U(()=>hd(l(d))),g=U(()=>{const ee=typeof window<"u"?window.location.origin:"http://localhost:5173",H=e.mode==="create"?`${ee}/api/${e.collectionKey}`:`${ee}/api/${e.collectionKey}/${r()}`,j=e.mode==="create"?"POST":"PUT",ne=JSON.stringify(t()).replace(/'/g,"'\\''");return`curl -X ${j} '${H}' \\
|
|
10
|
-
-H 'Content-Type: application/json' \\
|
|
11
|
-
-H 'Cookie: <session>' \\
|
|
12
|
-
-d '${ne}'`}),p=U(()=>hd(l(g)));function v(){A(s,l(d),!0),A(a,null),u=null,A(o,!0)}function m(){A(a,null),u=null;try{const ee=JSON.parse(l(s));if(typeof ee!="object"||ee===null||Array.isArray(ee)){A(a,"Top-level value must be a JSON object");return}u=ee}catch(ee){A(a,ee.message,!0)}}function h(){if(u){for(const ee of Object.keys(t()))delete t()[ee];for(const ee of Object.keys(u))t(t()[ee]=u[ee],!0);A(o,!1),e.onApply(),ze.success("JSON applied")}}function x(){A(o,!1),A(s,""),A(a,null),u=null}async function _(){const ee=l(i)==="json"?l(d):l(g);try{await navigator.clipboard.writeText(ee),A(c,!0),setTimeout(()=>A(c,!1),1500)}catch{ze.error("Copy failed")}}var S=f1(),k=w(S),b=w(k),C=w(b),T=N(C,2),O=N(b,2),E=w(O);{var D=ee=>{var H=o1(),j=w(H);zy(j,{class:"h-3.5 w-3.5"}),Z("click",H,v),y(ee,H)};W(E,ee=>{l(i)==="json"&&!l(o)&&ee(D)})}var L=N(E,2),V=w(L);{var J=ee=>{var H=s1(),j=q(H);Th(j,{class:"h-3.5 w-3.5 text-emerald-700"}),y(ee,H)},R=ee=>{var H=a1(),j=q(H);vy(j,{class:"h-3.5 w-3.5"}),y(ee,H)};W(V,ee=>{l(c)?ee(J):ee(R,-1)})}var P=N(k,2);{var K=ee=>{var H=te(),j=q(H);{var ne=z=>{var F=u1(),I=q(F),Y=N(I,2);{var ie=ge=>{var Te=l1(),Ne=w(Te);G(()=>$(Ne,`Invalid JSON: ${l(a)??""}`)),y(ge,Te)};W(Y,ge=>{l(a)&&ge(ie)})}var ue=N(Y,2),we=w(ue),me=N(we,2);G(()=>we.disabled=!u),Z("input",I,m),zt(I,()=>l(s),ge=>A(s,ge)),Z("click",we,h),Z("click",me,x),y(z,F)},B=z=>{var F=c1();Gl(F,()=>l(f),!0),y(z,F)};W(j,z=>{l(o)?z(ne):z(B,-1)})}y(ee,H)},Q=ee=>{var H=d1();Gl(H,()=>l(p),!0),y(ee,H)};W(P,ee=>{l(i)==="json"?ee(K):ee(Q,-1)})}G(()=>{be(C,1,`rounded-md px-3 py-1.5 text-xs font-medium transition-colors
|
|
13
|
-
${l(i)==="json"?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"}`),be(T,1,`rounded-md px-3 py-1.5 text-xs font-medium transition-colors
|
|
14
|
-
${l(i)==="curl"?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"}`)}),Z("click",C,()=>A(i,"json")),Z("click",T,()=>A(i,"curl")),Z("click",L,_),y(n,S),de()}ve(["click","input"]);var h1=M('<a class="inline-flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground"><!> View version history</a>');function v1(n,e){ce(e,!0);var t=h1(),r=w(t);Sy(r,{class:"h-3.5 w-3.5"}),G(i=>re(t,"href",i),[()=>Je(`/${e.collectionKey}/${e.recordId}/versions`)]),y(n,t),de()}var p1=M('<p class="text-xs text-destructive"> </p>'),m1=M('<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm" role="presentation"><div class="w-full max-w-md rounded-lg border border-border bg-card shadow-xl" role="dialog" aria-modal="true"><div class="flex items-center gap-3 border-b border-border/60 px-5 py-4"><div class="flex h-9 w-9 items-center justify-center rounded-lg bg-primary/10 text-primary"><!></div> <div><h2 class="text-sm font-semibold text-foreground">Schedule Publish</h2> <p class="text-xs text-muted-foreground">Post will publish automatically at the selected time.</p></div></div> <div class="px-5 py-5 space-y-2"><label class="block text-xs font-medium text-foreground" for="schedule-datetime">Publish at</label> <input id="schedule-datetime" type="datetime-local" class="w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary"/> <!></div> <div class="flex justify-end gap-2 border-t border-border/60 px-5 py-3"><button type="button" class="rounded-lg px-3 py-1.5 text-xs font-medium text-muted-foreground hover:bg-secondary hover:text-foreground disabled:opacity-50">Cancel</button> <button type="button" class="rounded-lg bg-primary px-4 py-1.5 text-xs font-semibold text-primary-foreground hover:bg-primary/90 disabled:opacity-60"> </button></div></div></div>');function _1(n,e){ce(e,!0);let t=se(e,"open",15,!1),r=se(e,"initialValue",3,""),i=se(e,"isSubmitting",3,!1);function o(){const p=new Date(Date.now()+36e5),v=m=>String(m).padStart(2,"0");return`${p.getFullYear()}-${v(p.getMonth()+1)}-${v(p.getDate())}T${v(p.getHours())}:${v(p.getMinutes())}`}let s=X(Be(r()||o())),a=X("");nt(()=>{t()&&!l(s)&&A(s,o(),!0)});function u(){if(A(a,""),!l(s)){A(a,"Pick a date and time");return}const p=new Date(l(s));if(isNaN(p.getTime())){A(a,"Invalid date");return}if(p.getTime()<=Date.now()){A(a,"Time must be in the future");return}e.onSchedule(p.toISOString())}function c(){t(!1),A(a,"")}var d=te(),f=q(d);{var g=p=>{var v=m1(),m=w(v),h=w(m),x=w(h),_=w(x);uy(_,{class:"h-5 w-5"});var S=N(h,2),k=N(w(S),2),b=N(k,2);{var C=L=>{var V=p1(),J=w(V);G(()=>$(J,l(a))),y(L,V)};W(b,L=>{l(a)&&L(C)})}var T=N(S,2),O=w(T),E=N(O,2),D=w(E);G(()=>{O.disabled=i(),E.disabled=i(),$(D,i()?"Scheduling…":"Schedule")}),Z("click",v,c),Z("click",m,L=>L.stopPropagation()),zt(k,()=>l(s),L=>A(s,L)),Z("click",O,c),Z("click",E,u),y(p,v)};W(f,p=>{t()&&p(g)})}y(n,d),de()}ve(["click"]);var b1=M('<span class="text-destructive">*</span>'),y1=M('<p class="mt-1 text-xs text-muted-foreground"> </p>'),x1=M('<p class="mt-1 text-xs text-destructive"> </p>'),w1=M('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <input type="text"/> <!> <!></div>');function dl(n,e){ce(e,!0);let t=se(e,"value",15);var r=w1(),i=w(r),o=w(i),s=N(o);{var a=p=>{var v=b1();y(p,v)};W(s,p=>{e.field.required&&p(a)})}var u=N(i,2),c=N(u,2);{var d=p=>{var v=y1(),m=w(v);G(()=>$(m,`Max ${e.field.maxLength??""} characters`)),y(p,v)};W(c,p=>{e.field.maxLength&&p(d)})}var f=N(c,2);{var g=p=>{var v=x1(),m=w(v);G(()=>$(m,e.error)),y(p,v)};W(f,p=>{e.error&&p(g)})}G(()=>{re(i,"for",e.field.name),$(o,`${e.field.label??""} `),re(u,"id",e.field.name),be(u,1,`h-10 w-full rounded-md border bg-background px-3 text-sm focus:outline-none focus:ring-2 focus:ring-ring ${e.error?"border-destructive":""}`),re(u,"placeholder",e.field.label),re(u,"minlength",e.field.minLength),re(u,"maxlength",e.field.maxLength),re(u,"pattern",e.field.pattern)}),zt(u,t),y(n,r),de()}var S1=M('<span class="text-destructive">*</span>'),k1=M('<p class="mt-1 text-xs text-destructive"> </p>'),C1=M('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <textarea></textarea> <!></div>');function E1(n,e){ce(e,!0);let t=se(e,"value",15);var r=C1(),i=w(r),o=w(i),s=N(o);{var a=f=>{var g=S1();y(f,g)};W(s,f=>{e.field.required&&f(a)})}var u=N(i,2);re(u,"rows",4);var c=N(u,2);{var d=f=>{var g=k1(),p=w(g);G(()=>$(p,e.error)),y(f,g)};W(c,f=>{e.error&&f(d)})}G(()=>{re(i,"for",e.field.name),$(o,`${e.field.label??""} `),re(u,"id",e.field.name),be(u,1,`w-full rounded-md border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring ${e.error?"border-destructive":""}`),re(u,"placeholder",e.field.label),re(u,"minlength",e.field.minLength),re(u,"maxlength",e.field.maxLength)}),zt(u,t),y(n,r),de()}var T1=M('<span class="text-destructive">*</span>'),N1=M('<p class="mt-1 text-xs text-destructive"> </p>'),A1=M('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <input type="number"/> <!></div>');function O1(n,e){ce(e,!0);let t=se(e,"value",15);function r(g){const v=g.target.value;t(v===""?null:e.field.integerOnly?parseInt(v,10):parseFloat(v))}var i=A1(),o=w(i),s=w(o),a=N(s);{var u=g=>{var p=T1();y(g,p)};W(a,g=>{e.field.required&&g(u)})}var c=N(o,2),d=N(c,2);{var f=g=>{var p=N1(),v=w(p);G(()=>$(v,e.error)),y(g,p)};W(d,g=>{e.error&&g(f)})}G(()=>{re(o,"for",e.field.name),$(s,`${e.field.label??""} `),re(c,"id",e.field.name),ir(c,t()??""),re(c,"min",e.field.min),re(c,"max",e.field.max),re(c,"step",e.field.integerOnly?1:"any"),be(c,1,`h-10 w-full rounded-md border bg-background px-3 text-sm focus:outline-none focus:ring-2 focus:ring-ring ${e.error?"border-destructive":""}`),re(c,"placeholder",e.field.label)}),Z("input",c,r),y(n,i),de()}ve(["input"]);var M1=M('<span class="text-destructive">*</span>'),P1=M('<p class="mt-1 text-xs text-destructive"> </p>'),D1=M('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <input type="email"/> <!></div>');function F1(n,e){ce(e,!0);let t=se(e,"value",15);var r=D1(),i=w(r),o=w(i),s=N(o);{var a=f=>{var g=M1();y(f,g)};W(s,f=>{e.field.required&&f(a)})}var u=N(i,2),c=N(u,2);{var d=f=>{var g=P1(),p=w(g);G(()=>$(p,e.error)),y(f,g)};W(c,f=>{e.error&&f(d)})}G(()=>{re(i,"for",e.field.name),$(o,`${e.field.label??""} `),re(u,"id",e.field.name),be(u,1,`h-10 w-full rounded-md border bg-background px-3 text-sm focus:outline-none focus:ring-2 focus:ring-ring ${e.error?"border-destructive":""}`),re(u,"placeholder",e.field.label)}),zt(u,t),y(n,r),de()}var I1=M('<span class="text-destructive">*</span>'),L1=M("<option> </option>"),R1=M('<p class="mt-1 text-xs text-destructive"> </p>'),z1=M('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <select><option> </option><!></select> <!></div>');function B1(n,e){ce(e,!0);let t=se(e,"value",15);var r=z1(),i=w(r),o=w(i),s=N(o);{var a=v=>{var m=I1();y(v,m)};W(s,v=>{e.field.required&&v(a)})}var u=N(i,2),c=w(u),d=w(c);c.value=c.__value="";var f=N(c);Re(f,17,()=>e.field.options||[],gt,(v,m)=>{var h=L1(),x=w(h),_={};G(()=>{$(x,l(m).label||l(m).value),_!==(_=l(m).value)&&(h.value=(h.__value=l(m).value)??"")}),y(v,h)});var g=N(u,2);{var p=v=>{var m=R1(),h=w(m);G(()=>$(h,e.error)),y(v,m)};W(g,v=>{e.error&&v(p)})}G(()=>{re(i,"for",e.field.name),$(o,`${e.field.label??""} `),re(u,"id",e.field.name),be(u,1,`h-10 w-full rounded-md border bg-background px-3 text-sm focus:outline-none focus:ring-2 focus:ring-ring ${e.error?"border-destructive":""}`),$(d,`Select ${e.field.label??""}`)}),vh(u,t),y(n,r),de()}var U1=M('<p class="mt-1 text-xs text-destructive"> </p>'),j1=M('<div><label class="flex items-center gap-2 cursor-pointer"><input type="checkbox" class="h-4 w-4 rounded border accent-primary"/> <span class="text-sm font-medium"> </span></label> <!></div>');function W1(n,e){ce(e,!0);let t=se(e,"value",15);var r=j1(),i=w(r),o=w(i),s=N(o,2),a=w(s),u=N(i,2);{var c=d=>{var f=U1(),g=w(f);G(()=>$(g,e.error)),y(d,f)};W(u,d=>{e.error&&d(c)})}G(()=>$(a,e.field.label)),Zu(o,t),y(n,r),de()}var K1=M('<span class="text-destructive">*</span>'),H1=M('<p class="mt-1 text-xs text-destructive"> </p>'),V1=M('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <input type="datetime-local"/> <!></div>');function J1(n,e){ce(e,!0);let t=se(e,"value",15);function r(v){if(!v)return"";const m=new Date(v);if(isNaN(m.getTime()))return"";const h=x=>String(x).padStart(2,"0");return`${m.getFullYear()}-${h(m.getMonth()+1)}-${h(m.getDate())}T${h(m.getHours())}:${h(m.getMinutes())}`}let i=U(()=>r(t()));function o(v){const m=v.target.value;if(!m){t(null);return}const h=new Date(m);t(isNaN(h.getTime())?null:h.toISOString())}var s=V1(),a=w(s),u=w(a),c=N(u);{var d=v=>{var m=K1();y(v,m)};W(c,v=>{e.field.required&&v(d)})}var f=N(a,2),g=N(f,2);{var p=v=>{var m=H1(),h=w(m);G(()=>$(h,e.error)),y(v,m)};W(g,v=>{e.error&&v(p)})}G(()=>{re(a,"for",e.field.name),$(u,`${e.field.label??""} `),re(f,"id",e.field.name),ir(f,l(i)),be(f,1,`h-10 w-full rounded-md border bg-background px-3 text-sm focus:outline-none focus:ring-2 focus:ring-ring ${e.error?"border-destructive":""}`)}),Z("input",f,o),y(n,s),de()}ve(["input"]);function le(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Bh(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);t.search=r.toString(),console.warn(`Minified Lexical warning #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Wn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,q1=Wn&&"documentMode"in document?document.documentMode:null,Dn=Wn&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),zr=Wn&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),aa=!(!Wn||!("InputEvent"in window)||q1)&&"getTargetRanges"in new window.InputEvent("input"),us=Wn&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),mo=Wn&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,G1=Wn&&/Android/.test(navigator.userAgent),Uh=Wn&&/^(?=.*Chrome).*/i.test(navigator.userAgent),vd=Wn&&G1&&Uh,cs=Wn&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Dn&&!Uh,Y1=0,Z1=1,X1=2,jh=128,Q1=1,$1=2,ew=3,tw=4,nw=5,rw=6,Oa=us||mo||cs?" ":"",Ma=`
|
|
15
|
-
|
|
16
|
-
`,iw=zr?" ":Oa,oi={bold:1,capitalize:1024,code:16,highlight:jh,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},ow={directionless:1,unmergeable:2},pd={center:2,end:6,justify:4,left:1,right:3,start:5},sw={[$1]:"center",[rw]:"end",[tw]:"justify",[Q1]:"left",[ew]:"right",[nw]:"start"},aw={normal:0,segmented:2,token:1},lw={[Y1]:"normal",[X1]:"segmented",[Z1]:"token"},md="$config";function Wh(n,e,t,r,i,o){let s=n.getFirstChild();for(;s!==null;){const a=s.__key;s.__parent===e&&(oe(s)&&Wh(s,a,t,r,i,o),t.has(a)||o.delete(a),i.push(a)),s=s.getNextSibling()}}let $l=!1,ic=0;function uw(n){ic=n.timeStamp}function fl(n,e,t){const r=n.nodeName==="BR",i=e.__lexicalLineBreak;return i&&(n===i||r&&n.previousSibling===i)||r&&Ka(n,t)!==void 0}function cw(n,e,t){const r=Kn(Pn(t));let i=null,o=null;r!==null&&r.anchorNode===n&&(i=r.anchorOffset,o=r.focusOffset);const s=n.nodeValue;s!==null&&kc(e,s,i,o,!1)}function dw(n,e,t){if(ae(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return kr(e)&&t.isAttached()}function fw(n,e,t,r){for(let i=n;i&&!f2(i);i=hs(i)){const o=Ka(i,e);if(o!==void 0){const s=yt(o,t);if(s)return rt(s)||!Ft(i)?void 0:[i,s]}else if(i===r)return[r,Kv(t)]}}function Kh(n,e,t){$l=!0;const r=performance.now()-ic>100;try{er(n,()=>{const i=fe()||(function(g){return g.getEditorState().read(()=>{const p=fe();return p!==null?p.clone():null})})(n),o=new Map,s=n.getRootElement(),a=n._editorState,u=n._blockCursorElement;let c=!1,d="";for(let g=0;g<e.length;g++){const p=e[g],v=p.type,m=p.target,h=fw(m,n,a,s);if(!h)continue;const[x,_]=h;if(v==="characterData")r&&pe(_)&&kr(m)&&dw(i,m,_)&&cw(m,_,n);else if(v==="childList"){c=!0;const S=p.addedNodes;for(let C=0;C<S.length;C++){const T=S[C],O=jv(T),E=T.parentNode;if(E!=null&&T!==u&&O===null&&!fl(T,E,n)){if(zr){const D=(Ft(T)?T.innerText:null)||T.nodeValue;D&&(d+=D)}E.removeChild(T)}}const k=p.removedNodes,b=k.length;if(b>0){let C=0;for(let T=0;T<b;T++){const O=k[T];(fl(O,m,n)||u===O)&&(m.appendChild(O),C++)}b!==C&&o.set(x,_)}}}if(o.size>0)for(const[g,p]of o)p.reconcileObservedMutation(g,n);const f=t.takeRecords();if(f.length>0){for(let g=0;g<f.length;g++){const p=f[g],v=p.addedNodes,m=p.target;for(let h=0;h<v.length;h++){const x=v[h],_=x.parentNode;_==null||x.nodeName!=="BR"||fl(x,m,n)||_.removeChild(x)}}t.takeRecords()}i!==null&&(c&&Qt(i),zr&&qv(n)&&i.insertRawText(d))})}finally{$l=!1}}function Hh(n){const e=n._observer;e!==null&&Kh(n,e.takeRecords(),e)}function Vh(n){(function(e){ic===0&&Pn(e).addEventListener("textInput",uw,!0)})(n),n._observer=new MutationObserver((e,t)=>{Kh(n,e,t)})}function Jh(n){const e=new Map,t=new Set;for(let r=typeof n=="function"?n:n.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){const{ownNodeConfig:i}=Va(r);if(i&&i.stateConfigs)for(const o of i.stateConfigs){let s;"stateConfig"in o?(s=o.stateConfig,o.flat&&t.add(s.key)):s=o,e.set(s.key,s)}}return{flatKeys:t,sharedConfigMap:e}}class oc{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,r=void 0,i=new Map,o=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=r,this.knownState=i;const{sharedConfigMap:s}=this.sharedNodeState,a=o!==void 0?o:(function(u,c,d){let f=d.size;if(c)for(const g in c){const p=u.get(g);p&&d.has(p)||f++}return f})(s,r,i);this.size=a}getValue(e){const t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let r=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){const i=this.unknownState[e.key];i!==void 0&&(r=e.parse(i)),this.updateFromKnown(e,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const e={...this.unknownState},t={};for(const[r,i]of this.knownState)r.isEqual(i,r.defaultValue)?delete e[r.key]:e[r.key]=r.unparse(i);for(const r of this.sharedNodeState.flatKeys)r in e&&(t[r]=e[r],delete e[r]);return _d(e)&&(t.$=e),t}getWritable(e){if(this.node===e)return this;const{sharedNodeState:t,unknownState:r}=this,i=new Map(this.knownState);return new oc(e,t,(function(o,s,a){let u;if(a)for(const[c,d]of Object.entries(a)){const f=o.get(c);f?s.has(f)||s.set(f,f.parse(d)):(u=u||{},u[c]=d)}return u})(t.sharedConfigMap,i,r),i,this.size)}updateFromKnown(e,t){const r=e.key;this.sharedNodeState.sharedConfigMap.set(r,e);const{knownState:i,unknownState:o}=this;i.has(e)||o&&r in o||(o&&(delete o[r],this.unknownState=_d(o)),this.size++),i.set(e,t)}updateFromUnknown(e,t){const r=this.sharedNodeState.sharedConfigMap.get(e);r?this.updateFromKnown(r,r.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){const{knownState:t}=this;for(const r of t.keys())t.set(r,r.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(const[r,i]of Object.entries(e))this.updateFromUnknown(r,i)}}function gw(n){const e=n.getWritable(),t=e.__state?e.__state.getWritable(e):new oc(e,qh(e));return e.__state=t,t}function qh(n){return n.__state?n.__state.sharedNodeState:Lv(Ha(),n.getType()).sharedNodeState}function _d(n){if(n)for(const e in n)return n}function bd(n,e,t){for(const[r,i]of e.knownState){if(n.has(r.key))continue;n.add(r.key);const o=t?t.getValue(r):r.defaultValue;if(o!==i&&!r.isEqual(o,i))return!0}return!1}function yd(n,e,t){const{unknownState:r}=e,i=t?t.unknownState:void 0;if(r){for(const[o,s]of Object.entries(r))if(!n.has(o)&&(n.add(o),s!==(i?i[o]:void 0)))return!0}return!1}function xd(n,e){const t=n.__state;return t&&t.node===n?t.getWritable(e):t}function wd(n,e){const t=n.__mode,r=n.__format,i=n.__style,o=e.__mode,s=e.__format,a=e.__style,u=n.__state,c=e.__state;return(t===null||t===o)&&(r===null||r===s)&&(i===null||i===a)&&(n.__state===null||u===c||(function(d,f){if(d===f)return!0;if(d&&f&&d.size!==f.size)return!1;const g=new Set;return!(d&&bd(g,d,f)||f&&bd(g,f,d)||d&&yd(g,d,f)||f&&yd(g,f,d))})(u,c))}function Sd(n,e){const t=n.mergeWithSibling(e),r=ct()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function kd(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&pe(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(wd(e,r)){r=Sd(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&pe(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(wd(r,t)){r=Sd(r,t);break}break}t.remove()}}else r.remove()}function ro(n){return Cd(n.anchor),Cd(n.focus),n}function Cd(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,i;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),i=!0):(r=e.getChildAtIndex(t),i=!1),pe(r)){n.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!oe(r))break;n.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}let si,tn,Jo,Pa,eu,tu,ai,Rn,nu,qo,It="",Vn=null,qr=null,Di=!1,la=!1;function ua(n,e){const t=ai.get(n);if(e!==null){const r=su(n);r.parentNode===e&&e.removeChild(r)}if(Rn.has(n)||tn._keyToDOMMap.delete(n),oe(t)){const r=da(t,ai);ru(r,0,r.length-1,null)}t!==void 0&&Cc(qo,Jo,Pa,t,"destroyed")}function ru(n,e,t,r){for(let i=e;i<=t;++i){const o=n[i];o!==void 0&&ua(o,r)}}function Hr(n,e){n.setProperty("text-align",e)}const hw="40px";function Gh(n,e){const t=si.theme.indent;if(typeof t=="string"){const i=n.classList.contains(t);e>0&&!i?n.classList.add(t):e<1&&i&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||hw;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function Yh(n,e){const t=n.style;e===0?Hr(t,""):e===1?Hr(t,"left"):e===2?Hr(t,"center"):e===3?Hr(t,"right"):e===4?Hr(t,"justify"):e===5?Hr(t,"start"):e===6&&Hr(t,"end")}function iu(n,e){const t=(function(r){const i=r.__dir;if(i!==null)return i;if(Rt(r))return null;const o=r.getParentOrThrow();return Rt(o)&&o.__dir===null?"auto":null})(e);t!==null?n.dir=t:n.removeAttribute("dir")}function ca(n,e){const t=Rn.get(n);t===void 0&&le(60);const r=t.createDOM(si,tn);if((function(i,o,s){const a=s._keyToDOMMap;(function(u,c,d){const f=`__lexicalKey_${c._key}`;u[f]=d})(o,s,i),a.set(i,o)})(n,r,tn),pe(t)?r.setAttribute("data-lexical-text","true"):rt(t)&&r.setAttribute("data-lexical-decorator","true"),oe(t)){const i=t.__indent,o=t.__size;if(iu(r,t),i!==0&&Gh(r,i),o!==0){const a=o-1;ou(da(t,Rn),t,0,a,t.getDOMSlot(r))}const s=t.__format;s!==0&&Yh(r,s),t.isInline()||Zh(null,t,r)}else{const i=t.getTextContent();if(rt(t)){const o=t.decorate(tn,si);o!==null&&Xh(n,o),r.contentEditable="false"}It+=i}return e!==null&&e.insertChild(r),Cc(qo,Jo,Pa,t,"created"),r}function ou(n,e,t,r,i){const o=It;It="";let s=t;for(;s<=r;++s){ca(n[s],i);const a=Rn.get(n[s]);a!==null&&pe(a)?Vn===null&&(Vn=a.getFormat(),qr=a.getStyle()):oe(a)&&s<r&&!a.isInline()&&(It+=Ma)}i.element.__lexicalTextContent=It,It=o+It}function Ed(n,e){if(n){const t=n.__last;if(t){const r=e.get(t);if(r)return Gi(r)?"line-break":rt(r)&&r.isInline()?"decorator":null}return"empty"}return null}function Zh(n,e,t){const r=Ed(n,ai),i=Ed(e,Rn);r!==i&&e.getDOMSlot(t).setManagedLineBreak(i)}function vw(n,e,t){var r;Vn=null,qr=null,(function(i,o,s){const a=It,u=i.__size,c=o.__size;It="";const d=s.element;if(u===1&&c===1){const f=i.__first,g=o.__first;if(f===g)Ks(f,d);else{const v=su(f),m=ca(g,null);try{d.replaceChild(m,v)}catch(h){if(typeof h=="object"&&h!=null){const x=`${h.toString()} Parent: ${d.tagName}, new child: {tag: ${m.tagName} key: ${g}}, old child: {tag: ${v.tagName}, key: ${f}}.`;throw new Error(x)}throw h}ua(f,null)}const p=Rn.get(g);pe(p)&&Vn===null&&(Vn=p.getFormat(),qr=p.getStyle())}else{const f=da(i,ai),g=da(o,Rn);if(f.length!==u&&le(227),g.length!==c&&le(228),u===0)c!==0&&ou(g,0,0,c-1,s);else if(c===0){if(u!==0){const p=s.after==null&&s.before==null&&s.element.__lexicalLineBreak==null;ru(f,0,u-1,p?null:d),p&&(d.textContent="")}}else(function(p,v,m,h,x,_){const S=h-1,k=x-1;let b,C,T=_.getFirstChild(),O=0,E=0;for(;O<=S&&E<=k;){const V=v[O],J=m[E];if(V===J)T=gl(Ks(J,_.element)),O++,E++;else{if(C===void 0&&(C=Td(m,E)),b===void 0)b=Td(v,O);else if(!b.has(V)){O++;continue}if(!C.has(V)){T=gl(su(V)),ua(V,_.element),O++,b.delete(V);continue}if(b.has(J)){const P=li(tn,J);P!==T&&_.withBefore(T).insertChild(P),T=gl(Ks(J,_.element)),O++,E++}else ca(J,_.withBefore(T)),E++}const R=Rn.get(J);R!==null&&pe(R)?Vn===null&&(Vn=R.getFormat(),qr=R.getStyle()):oe(R)&&E<=k&&!R.isInline()&&(It+=Ma)}const D=O>S,L=E>k;if(D&&!L){const V=m[k+1],J=V===void 0?null:tn.getElementByKey(V);ou(m,0,E,k,_.withBefore(J))}else L&&!D&&ru(v,O,S,_.element)})(0,f,g,u,c,s)}d.__lexicalTextContent=It,It=a+It})(n,e,e.getDOMSlot(t)),r=e,Vn==null||Vn===r.__textFormat||la||r.setTextFormat(Vn),(function(i){qr==null||qr===i.__textStyle||la||i.setTextStyle(qr)})(e)}function da(n,e){const t=[];let r=n.__first;for(;r!==null;){const i=e.get(r);i===void 0&&le(101),t.push(r),r=i.__next}return t}function Ks(n,e){const t=ai.get(n);let r=Rn.get(n);t!==void 0&&r!==void 0||le(61);const i=Di||tu.has(n)||eu.has(n),o=li(tn,n);if(t===r&&!i){let s;if(oe(t)){const a=o.__lexicalTextContent;typeof a=="string"?s=a:(s=t.getTextContent(),o.__lexicalTextContent=s)}else s=t.getTextContent();return It+=s,o}if(t!==r&&i&&Cc(qo,Jo,Pa,r,"updated"),r.updateDOM(t,o,si)){const s=ca(n,null);return e===null&&le(62),e.replaceChild(s,o),ua(n,null),s}if(oe(t)){oe(r)||le(334,n);const s=r.__indent;(Di||s!==t.__indent)&&Gh(o,s);const a=r.__format;if((Di||a!==t.__format)&&Yh(o,a),i)vw(t,r,o),Rt(r)||r.isInline()||Zh(t,r,o);else{const u=o.__lexicalTextContent;let c;typeof u=="string"?c=u:(c=t.getTextContent(),o.__lexicalTextContent=c),It+=c}if((Di||r.__dir!==t.__dir)&&(iu(o,r),Rt(r)&&!Di))for(const u of r.getChildren())oe(u)&&iu(li(tn,u.getKey()),u)}else{const s=r.getTextContent();if(rt(r)){const a=r.decorate(tn,si);a!==null&&Xh(n,a)}It+=s}if(!la&&Rt(r)&&r.__cachedText!==It){const s=r.getWritable();s.__cachedText=It,r=s}return o}function Xh(n,e){let t=tn._pendingDecorators;const r=tn._decorators;if(t===null){if(r[n]===e)return;t=Wv(tn)}t[n]=e}function gl(n){let e=n.nextSibling;return e!==null&&e===tn._blockCursorElement&&(e=e.nextSibling),e}function Td(n,e){const t=new Set;for(let r=e;r<n.length;r++)t.add(n[r]);return t}function pw(n,e,t,r,i,o){It="",Di=r===2,tn=t,si=t._config,Jo=t._nodes,Pa=tn._listeners.mutation,eu=i,tu=o,ai=n._nodeMap,Rn=e._nodeMap,la=e._readOnly,nu=new Map(t._keyToDOMMap);const s=new Map;return qo=s,Ks("root",null),tn=void 0,Jo=void 0,eu=void 0,tu=void 0,ai=void 0,Rn=void 0,si=void 0,nu=void 0,qo=void 0,s}function su(n){const e=nu.get(n);return e===void 0&&le(75,n),e}function Ae(n){return{type:n}}const Da=Ae("SELECTION_CHANGE_COMMAND"),mw=Ae("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Fa=Ae("CLICK_COMMAND"),Qh=Ae("BEFORE_INPUT_COMMAND"),$h=Ae("INPUT_COMMAND"),ev=Ae("COMPOSITION_START_COMMAND"),tv=Ae("COMPOSITION_END_COMMAND"),ei=Ae("DELETE_CHARACTER_COMMAND"),Vi=Ae("INSERT_LINE_BREAK_COMMAND"),Go=Ae("INSERT_PARAGRAPH_COMMAND"),Ji=Ae("CONTROLLED_TEXT_INSERTION_COMMAND"),Ia=Ae("PASTE_COMMAND"),au=Ae("REMOVE_TEXT_COMMAND"),Yo=Ae("DELETE_WORD_COMMAND"),Zo=Ae("DELETE_LINE_COMMAND"),wn=Ae("FORMAT_TEXT_COMMAND"),La=Ae("UNDO_COMMAND"),Ra=Ae("REDO_COMMAND"),nv=Ae("KEYDOWN_COMMAND"),rv=Ae("KEY_ARROW_RIGHT_COMMAND"),_w=Ae("MOVE_TO_END"),iv=Ae("KEY_ARROW_LEFT_COMMAND"),bw=Ae("MOVE_TO_START"),ov=Ae("KEY_ARROW_UP_COMMAND"),sv=Ae("KEY_ARROW_DOWN_COMMAND"),Xo=Ae("KEY_ENTER_COMMAND"),av=Ae("KEY_SPACE_COMMAND"),lv=Ae("KEY_BACKSPACE_COMMAND"),sc=Ae("KEY_ESCAPE_COMMAND"),uv=Ae("KEY_DELETE_COMMAND"),cv=Ae("KEY_TAB_COMMAND"),yw=Ae("INSERT_TAB_COMMAND"),xw=Ae("INDENT_CONTENT_COMMAND"),Nd=Ae("OUTDENT_CONTENT_COMMAND"),dv=Ae("DROP_COMMAND"),fv=Ae("FORMAT_ELEMENT_COMMAND"),ac=Ae("DRAGSTART_COMMAND"),gv=Ae("DRAGOVER_COMMAND"),ww=Ae("DRAGEND_COMMAND"),za=Ae("COPY_COMMAND"),lc=Ae("CUT_COMMAND"),lu=Ae("SELECT_ALL_COMMAND"),Sw=Ae("CLEAR_EDITOR_COMMAND"),kw=Ae("CLEAR_HISTORY_COMMAND"),Ns=Ae("CAN_REDO_COMMAND"),As=Ae("CAN_UNDO_COMMAND"),Cw=Ae("FOCUS_COMMAND"),Ew=Ae("BLUR_COMMAND"),Tw=Ae("KEY_MODIFIER_COMMAND"),cr=Object.freeze({}),uu=[["keydown",function(n,e){Qo=n.timeStamp,hv=n.key,!e.isComposing()&&_e(e,nv,n)}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;xo(t)&&r!=="touch"&&r!=="pen"&&n.button===0&&er(e,()=>{Rv(t)||(fu=!0)})}],["compositionstart",function(n,e){_e(e,ev,n)}],["compositionend",function(n,e){zr?Mo=!0:mo||!us&&!cs?_e(e,tv,n):(gu=!0,hu=n.data)}],["input",function(n,e){n.stopPropagation(),er(e,()=>{e.dispatchCommand($h,n)},{event:n}),Fi=null}],["click",function(n,e){er(e,()=>{const t=fe(),r=Kn(Pn(e)),i=yo();if(r){if(ae(t)){const o=t.anchor,s=o.getNode();if(o.type==="element"&&o.offset===0&&t.isCollapsed()&&!Rt(s)&&Mt().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&i!==null&&t.is(i))r.removeAllRanges(),t.dirty=!0;else if(n.detail===3&&!t.isCollapsed()&&s!==t.focus.getNode()){const a=on(s,u=>oe(u)&&!u.isInline());oe(a)&&a.select(0)}}else if(n.pointerType==="touch"||n.pointerType==="pen"){const o=r.anchorNode;(Ft(o)||kr(o))&&Qt(fc(i,r,e,n))}}_e(e,Fa,n)})}],["cut",cr],["copy",cr],["dragstart",cr],["dragover",cr],["dragend",cr],["paste",cr],["focus",cr],["blur",cr],["drop",cr]];aa&&uu.push(["beforeinput",(n,e)=>(function(t,r){const i=t.inputType;i==="deleteCompositionText"||zr&&qv(r)||i!=="insertCompositionText"&&_e(r,Qh,t)})(n,e)]);let Qo=0,hv=null,vv=0,Fi=null;const cu=new WeakMap,fa=new WeakMap;let du=!1,fu=!1,Lo=!1,Mo=!1,gu=!1,hu="",Gr=null,pv=[0,"",0,"root",0];function mv(n,e,t,r,i){const o=n.anchor,s=n.focus,a=o.getNode(),u=ct(),c=Kn(Pn(u)),d=c!==null?c.anchorNode:null,f=o.key,g=u.getElementByKey(f),p=t.length;return f!==s.key||!pe(a)||(!i&&(!aa||vv<r+50)||a.isDirty()&&p<2||Hv(t))&&o.offset!==s.offset&&!a.isComposing()||hr(a)||a.isDirty()&&p>1||(i||!aa)&&g!==null&&!a.isComposing()&&d!==oo(g)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||a.getFormat()!==n.format||a.getStyle()!==n.style||(function(v,m){if(m.isSegmented())return!0;if(!v.isCollapsed())return!1;const h=v.anchor.offset,x=m.getParentOrThrow(),_=ni(m);return h===0?!m.canInsertTextBefore()||!x.canInsertTextBefore()&&!m.isComposing()||_||(function(S){const k=S.getPreviousSibling();return(pe(k)||oe(k)&&k.isInline())&&!k.canInsertTextAfter()})(m):h===m.getTextContentSize()&&(!m.canInsertTextAfter()||!x.canInsertTextAfter()&&!m.isComposing()||_)})(n,a)}function Ad(n,e){return kr(n)&&n.nodeValue!==null&&e!==0&&e!==n.nodeValue.length}function Od(n,e,t){const{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}=n;du&&(du=!1,Ad(r,i)&&Ad(o,s)&&!Gr)||er(e,()=>{if(!t)return void Qt(null);if(!gs(e,r,o))return;let a=fe();if(Gr&&ae(a)&&a.isCollapsed()){const u=a.anchor,c=Gr.anchor;(u.key===c.key&&u.offset===c.offset+1||u.offset===1&&c.getNode().is(u.getNode().getPreviousSibling()))&&(a=Gr.clone(),Qt(a))}if(Gr=null,ae(a)){const u=a.anchor,c=u.getNode();if(a.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(a.dirty=!0);const d=Pn(e).event,f=d?d.timeStamp:performance.now(),[g,p,v,m,h]=pv,x=Mt(),_=e.isComposing()===!1&&x.getTextContent()==="";if(f<h+200&&u.offset===v&&u.key===m)Hs(a,g,p);else if(u.type==="text")pe(c)||le(141),_v(a,c);else if(u.type==="element"&&!_){oe(c)||le(259);const S=u.getNode();S.isEmpty()?(function(k,b){const C=b.getTextFormat(),T=b.getTextStyle();Hs(k,C,T)})(a,S):Hs(a,0,"")}}else{const d=u.key,f=a.focus.key,g=a.getNodes(),p=g.length,v=a.isBackward(),m=v?s:i,h=v?i:s,x=v?f:d,_=v?d:f;let S=2047,k=!1;for(let b=0;b<p;b++){const C=g[b],T=C.getTextContentSize();if(pe(C)&&T!==0&&!(b===0&&C.__key===x&&m===T||b===p-1&&C.__key===_&&h===0)&&(k=!0,S&=C.getFormat(),S===0))break}a.format=k?S:0}}_e(e,Da,void 0)})}function Hs(n,e,t){n.format===e&&n.style===t||(n.format=e,n.style=t,n.dirty=!0)}function _v(n,e){Hs(n,e.getFormat(),e.getStyle())}function bv(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function Nw(n){const e=n.inputType,t=bv(n),r=ct(),i=fe();if(e==="deleteContentBackward"){if(i===null){const f=yo();if(!ae(f))return!0;Qt(f.clone())}if(ae(i)){const f=i.anchor.key===i.focus.key;if(o=n.timeStamp,hv==="MediaLast"&&o<Qo+30&&r.isComposing()&&f){if(qt(null),Qo=0,setTimeout(()=>{er(r,()=>{qt(null)})},30),ae(i)){const g=i.anchor.getNode();g.markDirty(),pe(g)||le(142),_v(i,g)}}else{qt(null),n.preventDefault();const g=i.anchor.getNode(),p=g.getTextContent(),v=g.canInsertTextAfter(),m=i.anchor.offset===0&&i.focus.offset===p.length;let h=vd&&f&&!m&&v;if(h&&i.isCollapsed()&&(h=!rt(yu(i.anchor,!0))),!h){_e(r,ei,!0);const x=fe();vd&&ae(x)&&x.isCollapsed()&&(Gr=x,setTimeout(()=>Gr=null))}}return!0}}var o;if(!ae(i))return!0;const s=n.data;Fi!==null&&Sc(!1,r,Fi),i.dirty&&Fi===null||!i.isCollapsed()||Rt(i.anchor.getNode())||t===null||i.applyDOMRange(t),Fi=null;const a=i.anchor,u=i.focus,c=a.getNode(),d=u.getNode();if(e==="insertText"||e==="insertTranspose"){if(s===`
|
|
17
|
-
`)n.preventDefault(),_e(r,Vi,!1);else if(s===Ma)n.preventDefault(),_e(r,Go,void 0);else if(s==null&&n.dataTransfer){const f=n.dataTransfer.getData("text/plain");n.preventDefault(),i.insertRawText(f)}else s!=null&&mv(i,t,s,n.timeStamp,!0)?(n.preventDefault(),_e(r,Ji,s)):Fi=s;return vv=n.timeStamp,!0}switch(n.preventDefault(),e){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":_e(r,Ji,n);break;case"insertFromComposition":qt(null),_e(r,Ji,n);break;case"insertLineBreak":qt(null),_e(r,Vi,!1);break;case"insertParagraph":qt(null),Lo&&!mo?(Lo=!1,_e(r,Vi,!1)):_e(r,Go,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":_e(r,Ia,n);break;case"deleteByComposition":(function(f,g){return f!==g||oe(f)||oe(g)||!ni(f)||!ni(g)})(c,d)&&_e(r,au,n);break;case"deleteByDrag":case"deleteByCut":_e(r,au,n);break;case"deleteContent":_e(r,ei,!1);break;case"deleteWordBackward":_e(r,Yo,!0);break;case"deleteWordForward":_e(r,Yo,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":_e(r,Zo,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":_e(r,Zo,!1);break;case"formatStrikeThrough":_e(r,wn,"strikethrough");break;case"formatBold":_e(r,wn,"bold");break;case"formatItalic":_e(r,wn,"italic");break;case"formatUnderline":_e(r,wn,"underline");break;case"historyUndo":_e(r,La,void 0);break;case"historyRedo":_e(r,Ra,void 0)}return!0}function Aw(n){if(Ft(n.target)&&Rv(n.target))return!0;const e=ct(),t=fe(),r=n.data,i=bv(n);if(r!=null&&ae(t)&&mv(t,i,r,n.timeStamp,!1)){Mo&&(ga(e,r),Mo=!1);const o=t.anchor.getNode(),s=Kn(Pn(e));if(s===null)return!0;const a=t.isBackward(),u=a?t.anchor.offset:t.focus.offset,c=a?t.focus.offset:t.anchor.offset;aa&&!t.isCollapsed()&&pe(o)&&s.anchorNode!==null&&o.getTextContent().slice(0,u)+r+o.getTextContent().slice(u+c)===Jv(s.anchorNode)||_e(e,Ji,r);const d=r.length;zr&&d>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=d),us||mo||cs||!e.isComposing()||(Qo=0,qt(null))}else Sc(!1,e,r!==null?r:void 0),Mo&&(ga(e,r||void 0),Mo=!1);return(function(){Jt();const o=ct();Hh(o)})(),!0}function Ow(n){const e=ct(),t=fe();if(ae(t)&&!e.isComposing()){const r=t.anchor,i=t.anchor.getNode();qt(r.key),(n.timeStamp<Qo+30||r.type==="element"||!t.isCollapsed()||i.getFormat()!==t.format||pe(i)&&i.getStyle()!==t.style)&&_e(e,Ji,iw)}return!0}function Mw(n){return ga(ct(),n.data),!0}function ga(n,e){const t=n._compositionKey;if(qt(null),t!==null&&e!=null){if(e===""){const r=yt(t),i=oo(n.getElementByKey(t));return void(i!==null&&i.nodeValue!==null&&pe(r)&&kc(r,i.nodeValue,null,null,!0))}if(e[e.length-1]===`
|
|
18
|
-
`){const r=fe();if(ae(r)){const i=r.focus;return r.anchor.set(i.key,i.offset,i.type),void _e(n,Xo,null)}}}Sc(!0,n,e)}function Pw(n){const e=ct();if(n.key==null)return!0;if(gu&&nf(n))return er(e,()=>{ga(e,hu)}),gu=!1,hu="",!0;if((function(t){return st(t,"ArrowRight",{shiftKey:"any"})})(n))_e(e,rv,n);else if((function(t){return st(t,"ArrowRight",fr)})(n))_e(e,_w,n);else if((function(t){return st(t,"ArrowLeft",{shiftKey:"any"})})(n))_e(e,iv,n);else if((function(t){return st(t,"ArrowLeft",fr)})(n))_e(e,bw,n);else if((function(t){return st(t,"ArrowUp",{altKey:"any",shiftKey:"any"})})(n))_e(e,ov,n);else if((function(t){return st(t,"ArrowDown",{altKey:"any",shiftKey:"any"})})(n))_e(e,sv,n);else if((function(t){return st(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})})(n))Lo=!0,_e(e,Xo,n);else if((function(t){return t.key===" "})(n))_e(e,av,n);else if((function(t){return Dn&&st(t,"o",{ctrlKey:!0})})(n))n.preventDefault(),Lo=!0,_e(e,Vi,!0);else if((function(t){return st(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})})(n))Lo=!1,_e(e,Xo,n);else if((function(t){return st(t,"Backspace",{shiftKey:"any"})||Dn&&st(t,"h",{ctrlKey:!0})})(n))nf(n)?_e(e,lv,n):(n.preventDefault(),_e(e,ei,!0));else if((function(t){return t.key==="Escape"})(n))_e(e,sc,n);else if((function(t){return st(t,"Delete",{})||Dn&&st(t,"d",{ctrlKey:!0})})(n))(function(t){return t.key==="Delete"})(n)?_e(e,uv,n):(n.preventDefault(),_e(e,ei,!1));else if((function(t){return st(t,"Backspace",tf)})(n))n.preventDefault(),_e(e,Yo,!0);else if((function(t){return st(t,"Delete",tf)})(n))n.preventDefault(),_e(e,Yo,!1);else if((function(t){return Dn&&st(t,"Backspace",{metaKey:!0})})(n))n.preventDefault(),_e(e,Zo,!0);else if((function(t){return Dn&&(st(t,"Delete",{metaKey:!0})||st(t,"k",{ctrlKey:!0}))})(n))n.preventDefault(),_e(e,Zo,!1);else if((function(t){return st(t,"b",fr)})(n))n.preventDefault(),_e(e,wn,"bold");else if((function(t){return st(t,"u",fr)})(n))n.preventDefault(),_e(e,wn,"underline");else if((function(t){return st(t,"i",fr)})(n))n.preventDefault(),_e(e,wn,"italic");else if((function(t){return st(t,"Tab",{shiftKey:"any"})})(n))_e(e,cv,n);else if((function(t){return st(t,"z",fr)})(n))n.preventDefault(),_e(e,La,void 0);else if((function(t){return Dn?st(t,"z",{metaKey:!0,shiftKey:!0}):st(t,"y",{ctrlKey:!0})||st(t,"z",{ctrlKey:!0,shiftKey:!0})})(n))n.preventDefault(),_e(e,Ra,void 0);else{const t=e._editorState._selection;t===null||ae(t)?rf(n)&&(n.preventDefault(),_e(e,lu,n)):(function(r){return st(r,"c",fr)})(n)?(n.preventDefault(),_e(e,za,n)):(function(r){return st(r,"x",fr)})(n)?(n.preventDefault(),_e(e,lc,n)):rf(n)&&(n.preventDefault(),_e(e,lu,n))}return(function(t){return t.ctrlKey||t.shiftKey||t.altKey||t.metaKey})(n)&&e.dispatchCommand(Tw,n),!0}function yv(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}const qi=new Map;function xv(n){const e=u2(n.target);if(e===null)return;const t=zv(e.anchorNode);if(t===null)return;fu&&(fu=!1,er(t,()=>{const u=yo(),c=e.anchorNode;(Ft(c)||kr(c))&&Qt(fc(u,e,t,n))}));const r=wc(t),i=r[r.length-1],o=i._key,s=qi.get(o),a=s||i;a!==t&&Od(e,a,!1),Od(e,t,!0),t!==i?qi.set(o,t):s&&qi.delete(o)}function Md(n){n._lexicalHandled=!0}function Pd(n){return n._lexicalHandled===!0}function Dw(n){const e=cu.get(n);if(e===void 0)return;const t=fa.get(e);if(t===void 0)return;const r=t-1;r>=0||le(164),cu.delete(n),fa.set(e,r),r===0&&e.removeEventListener("selectionchange",xv);const i=Wa(n);xc(i)?((function(s){if(s._parentEditor!==null){const a=wc(s),u=a[a.length-1]._key;qi.get(u)===s&&qi.delete(u)}else qi.delete(s._key)})(i),n.__lexicalEditor=null):i&&le(198);const o=yv(n);for(let s=0;s<o.length;s++)o[s]();n.__lexicalEventHandles=[]}function vu(n,e,t){Jt();const r=n.__key,i=n.getParent();if(i===null)return;const o=(function(a){const u=fe();if(!ae(u)||!oe(a))return u;const{anchor:c,focus:d}=u,f=c.getNode(),g=d.getNode();return xu(f,a)&&c.set(a.__key,0,"element"),xu(g,a)&&d.set(a.__key,0,"element"),u})(n);let s=!1;if(ae(o)&&e){const a=o.anchor,u=o.focus;a.key===r&&(pa(a,n,i,n.getPreviousSibling(),n.getNextSibling()),s=!0),u.key===r&&(pa(u,n,i,n.getPreviousSibling(),n.getNextSibling()),s=!0)}else kt(o)&&e&&n.isSelected()&&n.selectPrevious();if(ae(o)&&e&&!s){const a=n.getIndexWithinParent();ri(n),va(o,i,a,-1)}else ri(n);t||cn(i)||i.canBeEmpty()||!i.isEmpty()||vu(i,e),e&&o&&Rt(i)&&i.isEmpty()&&i.selectEnd()}const wv=Symbol.for("ephemeral");function ha(n){return n[wv]||!1}class $n{__type;__key;__parent;__prev;__next;__state;static getType(){const{ownNodeType:e}=Va(this);return e===void 0&&le(64,this.name),e}static clone(e){le(65,this.name)}$config(){return{}}config(e,t){const r=t.extends||Object.getPrototypeOf(this.constructor);return Object.assign(t,{extends:r,type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),n2(this,e)}getType(){return this.__type}isInline(){le(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;const t=yt(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){const t=e||fe();if(t==null)return!1;const r=t.getNodes().some(i=>i.__key===this.__key);if(pe(this))return r;if(ae(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const i=this.getParent();if(rt(this)&&this.isInline()&&i){const o=t.isBackward()?t.focus:t.anchor;if(i.is(o.getNode())&&o.offset===i.getChildrenSize()&&this.is(i.getLastChild()))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),r=0;for(;t!==null;){if(this.is(t))return r;r++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return e===null?null:yt(e)}getParentOrThrow(){const e=this.getParent();return e===null&&le(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(cn(t))return oe(e)||e===this&&rt(e)||le(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&le(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return e===null?null:yt(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(t===null)return e;let r=t.getFirstChild();for(;r!==null&&!r.is(this);)e.push(r),r=r.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return e===null?null:yt(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=oe(this)?this:this.getParent(),r=oe(e)?e:e.getParent(),i=t&&r?Js(t,r):null;return i?i.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){const t=Js(this,e);return t!==null&&(t.type==="descendant"||(t.type==="branch"?$v(t)===-1:(t.type!=="same"&&t.type!=="ancestor"&&le(279),!1)))}isParentOf(e){const t=Js(this,e);return t!==null&&t.type==="ancestor"}getNodesBetween(e){const t=this.isBefore(e),r=[],i=new Set;let o=this;for(;o!==null;){const s=o.__key;if(i.has(s)||(i.add(s),r.push(o)),o===e)break;const a=oe(o)?t?o.getFirstChild():o.getLastChild():null;if(a!==null){o=a;continue}const u=t?o.getNextSibling():o.getPreviousSibling();if(u!==null){o=u;continue}const c=o.getParentOrThrow();if(i.has(c.__key)||r.push(c),c===e)break;let d=null,f=c;do{if(f===null&&le(68),d=t?f.getNextSibling():f.getPreviousSibling(),f=f.getParent(),f===null)break;d!==null||i.has(f.__key)||r.push(f)}while(d===null);o=d}return t||r.reverse(),r}isDirty(){const e=ct()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(ha(this))return this;const e=yt(this.__key);return e===null&&le(113),e}getWritable(){if(ha(this))return this;Jt();const e=Wr(),t=ct(),r=e._nodeMap,i=this.__key,o=this.getLatest(),s=t._cloneNotNeeded,a=fe();if(a!==null&&a.setCachedNodes(null),s.has(i))return _a(o),o;const u=Zv(o);return s.add(i),_a(u),r.set(i,u),u}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){le(70)}updateDOM(e,t,r){le(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){const e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){le(18,this.name)}updateFromJSON(e){return(function(t,r){const i=t.getWritable(),o=r.$;let s=o;for(const a of qh(i).flatKeys)a in r&&(s!==void 0&&s!==o||(s={...o}),s[a]=r[a]);return(i.__state||s)&&gw(t).updateFromJSON(s),i})(this,e)}static transform(){return null}remove(e){vu(this,!0,e)}replace(e,t){Jt();let r=fe();r!==null&&(r=r.clone()),bl(this,e);const i=this.getLatest(),o=this.__key,s=e.__key,a=e.getWritable(),u=this.getParentOrThrow().getWritable(),c=u.__size;ri(a);const d=i.getPreviousSibling(),f=i.getNextSibling(),g=i.__prev,p=i.__next,v=i.__parent;if(vu(i,!1,!0),d===null?u.__first=s:d.getWritable().__next=s,a.__prev=g,f===null?u.__last=s:f.getWritable().__prev=s,a.__next=p,a.__parent=v,u.__size=c,t&&(oe(this)&&oe(a)||le(139),this.getChildren().forEach(m=>{a.append(m)})),ae(r)){Qt(r);const m=r.anchor,h=r.focus;m.key===o&&Rd(m,a),h.key===o&&Rd(h,a)}return Nr()===o&&qt(s),a}insertAfter(e,t=!0){Jt(),bl(this,e);const r=this.getWritable(),i=e.getWritable(),o=i.getParent(),s=fe();let a=!1,u=!1;if(o!==null){const p=e.getIndexWithinParent();if(ri(i),ae(s)){const v=o.__key,m=s.anchor,h=s.focus;a=m.type==="element"&&m.key===v&&m.offset===p+1,u=h.type==="element"&&h.key===v&&h.offset===p+1}}const c=this.getNextSibling(),d=this.getParentOrThrow().getWritable(),f=i.__key,g=r.__next;if(c===null?d.__last=f:c.getWritable().__prev=f,d.__size++,r.__next=f,i.__next=g,i.__prev=r.__key,i.__parent=r.__parent,t&&ae(s)){const p=this.getIndexWithinParent();va(s,d,p+1);const v=d.__key;a&&s.anchor.set(v,p+2,"element"),u&&s.focus.set(v,p+2,"element")}return e}insertBefore(e,t=!0){Jt(),bl(this,e);const r=this.getWritable(),i=e.getWritable(),o=i.__key;ri(i);const s=this.getPreviousSibling(),a=this.getParentOrThrow().getWritable(),u=r.__prev,c=this.getIndexWithinParent();s===null?a.__first=o:s.getWritable().__next=o,a.__size++,r.__prev=o,i.__prev=u,i.__next=r.__key,i.__parent=r.__parent;const d=fe();return t&&ae(d)&&va(d,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return xt()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){Jt();const r=this.getPreviousSibling(),i=this.getParentOrThrow();if(r===null)return i.select(0,0);if(oe(r))return r.select();if(!pe(r)){const o=r.getIndexWithinParent()+1;return i.select(o,o)}return r.select(e,t)}selectNext(e,t){Jt();const r=this.getNextSibling(),i=this.getParentOrThrow();if(r===null)return i.select();if(oe(r))return r.select(0,0);if(!pe(r)){const o=r.getIndexWithinParent();return i.select(o,o)}return r.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}const pu="historic",Fw="history-push",ti="history-merge",Iw="paste",Lw="collaboration",Rw="skip-scroll-into-view",zw="skip-dom-selection",Dd="skip-selection-focus";class bi extends $n{static getType(){return"linebreak"}static clone(e){return new bi(e.__key)}constructor(e){super(e)}getTextContent(){return`
|
|
19
|
-
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>(function(t){const r=t.parentElement;if(r!==null&&ba(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&Os(i)){const o=r.lastChild;if(o===t||o.previousSibling===t&&Os(o))return!0}}return!1})(e)||(function(t){const r=t.parentElement;if(r!==null&&ba(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&Os(i))return!1;const o=r.lastChild;if(o===t||o.previousSibling===t&&Os(o))return!0}return!1})(e)?null:{conversion:Bw,priority:0}}}static importJSON(e){return wr().updateFromJSON(e)}}function Bw(n){return{node:wr()}}function wr(){return dn(new bi)}function Gi(n){return n instanceof bi}function Os(n){return kr(n)&&/^( |\t|\r?\n)+$/.test(n.textContent||"")}function hl(n,e){return 16&e?"code":e&jh?"mark":32&e?"sub":64&e?"sup":null}function vl(n,e){return 1&e?"strong":2&e?"em":"span"}function Sv(n,e,t,r,i){const o=r.classList;let s=Yi(i,"base");s!==void 0&&o.add(...s),s=Yi(i,"underlineStrikethrough");let a=!1;const u=8&e&&4&e;s!==void 0&&(8&t&&4&t?(a=!0,u||o.add(...s)):u&&o.remove(...s));for(const c in oi){const d=oi[c];if(s=Yi(i,c),s!==void 0)if(t&d){if(a&&(c==="underline"||c==="strikethrough")){e&d&&o.remove(...s);continue}((e&d)===0||u&&c==="underline"||c==="strikethrough")&&o.add(...s)}else e&d&&o.remove(...s)}}function kv(n,e,t){const r=e.firstChild,i=t.isComposing(),o=n+(i?Oa:"");if(r==null)e.textContent=o;else{const s=r.nodeValue;if(s!==o)if(i||zr){const[a,u,c]=(function(d,f){const g=d.length,p=f.length;let v=0,m=0;for(;v<g&&v<p&&d[v]===f[v];)v++;for(;m+v<g&&m+v<p&&d[g-m-1]===f[p-m-1];)m++;return[v,g-v-m,f.slice(v,p-m)]})(s,o);u!==0&&r.deleteData(a,u),r.insertData(a,c)}else r.nodeValue=o}}function Fd(n,e,t,r,i,o){kv(i,n,e);const s=o.theme.text;s!==void 0&&Sv(0,0,r,n,s)}function Ms(n,e){const t=document.createElement(e);return t.appendChild(n),t}class Mn extends $n{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(e){return new Mn(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e="",t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return lw[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Nr()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=oi[e];return(this.getFormat()&t)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return ma(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){const r=this.__format,i=hl(0,r),o=vl(0,r),s=i===null?o:i,a=document.createElement(s);let u=a;this.hasFormat("code")&&a.setAttribute("spellcheck","false"),i!==null&&(u=document.createElement(o),a.appendChild(u)),Fd(u,this,0,r,this.__text,e);const c=this.__style;return c!==""&&(a.style.cssText=c),a}updateDOM(e,t,r){const i=this.__text,o=e.__format,s=this.__format,a=hl(0,o),u=hl(0,s),c=vl(0,o),d=vl(0,s);if((a===null?c:a)!==(u===null?d:u))return!0;if(a===u&&c!==d){const m=t.firstChild;m==null&&le(48);const h=document.createElement(d);return Fd(h,this,0,s,i,r),t.replaceChild(h,m),!1}let f=t;u!==null&&a!==null&&(f=t.firstChild,f==null&&le(49)),kv(i,f,this);const g=r.theme.text;g!==void 0&&o!==s&&Sv(0,o,s,f,g);const p=e.__style,v=this.__style;return p!==v&&(t.style.cssText=v),!1}static importDOM(){return{"#text":()=>({conversion:Kw,priority:0}),b:()=>({conversion:jw,priority:0}),code:()=>({conversion:dr,priority:0}),em:()=>({conversion:dr,priority:0}),i:()=>({conversion:dr,priority:0}),mark:()=>({conversion:dr,priority:0}),s:()=>({conversion:dr,priority:0}),span:()=>({conversion:Uw,priority:0}),strong:()=>({conversion:dr,priority:0}),sub:()=>({conversion:dr,priority:0}),sup:()=>({conversion:dr,priority:0}),u:()=>({conversion:dr,priority:0})}}static importJSON(e){return Bt().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return Ft(t)||le(132),t.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?t.style.textTransform="lowercase":this.hasFormat("uppercase")?t.style.textTransform="uppercase":this.hasFormat("capitalize")&&(t.style.textTransform="capitalize"),this.hasFormat("bold")&&(t=Ms(t,"b")),this.hasFormat("italic")&&(t=Ms(t,"i")),this.hasFormat("strikethrough")&&(t=Ms(t,"s")),this.hasFormat("underline")&&(t=Ms(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format=typeof e=="string"?oi[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail=typeof e=="string"?ow[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=ma(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=aw[e];if(this.__mode===t)return this;const r=this.getWritable();return r.__mode=t,r}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){Jt();let r=e,i=t;const o=fe(),s=this.getTextContent(),a=this.__key;if(typeof s=="string"){const u=s.length;r===void 0&&(r=u),i===void 0&&(i=u)}else r=0,i=0;if(!ae(o))return Tv(a,r,a,i,"text","text");{const u=Nr();u!==o.anchor.key&&u!==o.focus.key||qt(a),o.setTextNodeRange(this,r,this,i)}return o}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,r,i){const o=this.getWritable(),s=o.__text,a=r.length;let u=e;u<0&&(u=a+u,u<0&&(u=0));const c=fe();if(i&&ae(c)){const f=e+a;c.setTextNodeRange(o,f,o,f)}const d=s.slice(0,u)+r+s.slice(u+t);return o.__text=d,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){Jt();const t=this.getLatest(),r=t.getTextContent();if(r==="")return[];const i=t.__key,o=Nr(),s=r.length;e.sort((O,E)=>O-E),e.push(s);const a=[],u=e.length;for(let O=0,E=0;O<s&&E<=u;E++){const D=e[E];D>O&&(a.push(r.slice(O,D)),O=D)}const c=a.length;if(c===1)return[t];const d=a[0],f=t.getParent();let g;const p=t.getFormat(),v=t.getStyle(),m=t.__detail;let h=!1,x=null,_=null;const S=fe();if(ae(S)){const[O,E]=S.isBackward()?[S.focus,S.anchor]:[S.anchor,S.focus];O.type==="text"&&O.key===i&&(x=O),E.type==="text"&&E.key===i&&(_=E)}t.isSegmented()?(g=Bt(d),g.__format=p,g.__style=v,g.__detail=m,g.__state=xd(t,g),h=!0):g=t.setTextContent(d);const k=[g];for(let O=1;O<c;O++){const E=Bt(a[O]);E.__format=p,E.__style=v,E.__detail=m,E.__state=xd(t,E);const D=E.__key;o===i&&qt(D),k.push(E)}const b=x?x.offset:null,C=_?_.offset:null;let T=0;for(const O of k){if(!x&&!_)break;const E=T+O.getTextContentSize();if(x!==null&&b!==null&&b<=E&&b>=T&&(x.set(O.getKey(),b-T,"text"),b<E&&(x=null)),_!==null&&C!==null&&C<=E&&C>=T){_.set(O.getKey(),C-T,"text");break}T=E}if(f!==null){(function(D){const L=D.getPreviousSibling(),V=D.getNextSibling();L!==null&&_a(L),V!==null&&_a(V)})(this);const O=f.getWritable(),E=this.getIndexWithinParent();h?(O.splice(E,0,k),this.remove()):O.splice(E,1,k),ae(S)&&va(S,f,E,c-1)}return k}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||le(50);const r=this.__key,i=e.__key,o=this.__text,s=o.length;Nr()===i&&qt(r);const a=fe();if(ae(a)){const f=a.anchor,g=a.focus;f!==null&&f.key===i&&Hd(f,t,r,e,s),g!==null&&g.key===i&&Hd(g,t,r,e,s)}const u=e.__text,c=t?u+o:o+u;this.setTextContent(c);const d=this.getWritable();return e.remove(),d}isTextEntity(){return!1}}function Uw(n){return{forChild:uc(n.style),node:null}}function jw(n){const e=n,t=e.style.fontWeight==="normal";return{forChild:uc(e.style,t?void 0:"bold"),node:null}}const Id=new WeakMap;function Ww(n){if(!Ft(n))return!1;if(n.nodeName==="PRE")return!0;const e=n.style.whiteSpace;return typeof e=="string"&&e.startsWith("pre")}function Kw(n){const e=n;n.parentElement===null&&le(129);let t=e.textContent||"";if((function(r){let i,o=r.parentNode;const s=[r];for(;o!==null&&(i=Id.get(o))===void 0&&!Ww(o);)s.push(o),o=o.parentNode;const a=i===void 0?o:i;for(let u=0;u<s.length;u++)Id.set(s[u],a);return a})(e)!==null){const r=t.split(/(\r?\n|\t)/),i=[],o=r.length;for(let s=0;s<o;s++){const a=r[s];a===`
|
|
20
|
-
`||a===`\r
|
|
21
|
-
`?i.push(wr()):a===" "?i.push(bo()):a!==""&&i.push(Bt(a))}return{node:i}}if(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," "),t==="")return{node:null};if(t[0]===" "){let r=e,i=!0;for(;r!==null&&(r=Ld(r,!1))!==null;){const o=r.textContent||"";if(o.length>0){/[ \t\n]$/.test(o)&&(t=t.slice(1)),i=!1;break}}i&&(t=t.slice(1))}if(t[t.length-1]===" "){let r=e,i=!0;for(;r!==null&&(r=Ld(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){i=!1;break}i&&(t=t.slice(0,t.length-1))}return t===""?{node:null}:{node:Bt(t)}}function Ld(n,e){let t=n;for(;;){let r;for(;(r=e?t.nextSibling:t.previousSibling)===null;){const o=t.parentElement;if(o===null)return null;t=o}if(t=r,Ft(t)){const o=t.style.display;if(o===""&&!ku(t)||o!==""&&!o.startsWith("inline"))return null}let i=t;for(;(i=e?t.firstChild:t.lastChild)!==null;)t=i;if(kr(t))return t;if(t.nodeName==="BR")return null}}const Hw={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function dr(n){const e=Hw[n.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:uc(n.style,e),node:null}}function Bt(n=""){return dn(new Mn(n))}function pe(n){return n instanceof Mn}function uc(n,e){const t=n.fontWeight,r=n.textDecoration.split(" "),i=t==="700"||t==="bold",o=r.includes("line-through"),s=n.fontStyle==="italic",a=r.includes("underline"),u=n.verticalAlign;return c=>(pe(c)&&(i&&!c.hasFormat("bold")&&c.toggleFormat("bold"),o&&!c.hasFormat("strikethrough")&&c.toggleFormat("strikethrough"),s&&!c.hasFormat("italic")&&c.toggleFormat("italic"),a&&!c.hasFormat("underline")&&c.toggleFormat("underline"),u!=="sub"||c.hasFormat("subscript")||c.toggleFormat("subscript"),u!=="super"||c.hasFormat("superscript")||c.toggleFormat("superscript"),e&&!c.hasFormat(e)&&c.toggleFormat(e)),c)}class _o extends Mn{static getType(){return"tab"}static clone(e){return new _o(e.__key)}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}createDOM(e){const t=super.createDOM(e),r=Yi(e.theme,"tab");return r!==void 0&&t.classList.add(...r),t}static importJSON(e){return bo().updateFromJSON(e)}setTextContent(e){return e!==" "&&e!==""&&Bh(126),super.setTextContent(" ")}spliceText(e,t,r,i){return r===""&&t===0||r===" "&&t===1||le(286),this}setDetail(e){return e!==2&&le(127),this}setMode(e){return e!=="normal"&&le(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function bo(){return dn(new _o)}function Ba(n){return n instanceof _o}class Vw{key;offset;type;_selection;constructor(e,t,r){this._selection=null,this.key=e,this.offset=t,this.type=r}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:Qv(Sn(Sr(this,"next")),Sn(Sr(e,"next")))<0}getNode(){const e=yt(this.key);return e===null&&le(20),e}set(e,t,r,i){const o=this._selection,s=this.key;i&&this.key===e&&this.offset===t&&this.type===r||(this.key=e,this.offset=t,this.type=r,ds()||(Nr()===s&&qt(e),o!==null&&(o.setCachedNodes(null),o.dirty=!0)))}}function sr(n,e,t){return new Vw(n,e,t)}function pl(n,e){let t=e.__key,r=n.offset,i="element";if(pe(e)){i="text";const o=e.getTextContentSize();r>o&&(r=o)}else if(!oe(e)){const o=e.getNextSibling();if(pe(o))t=o.__key,r=0,i="text";else{const s=e.getParent();s&&(t=s.__key,r=e.getIndexWithinParent()+1)}}n.set(t,r,i)}function Rd(n,e){if(oe(e)){const t=e.getLastDescendant();oe(t)||pe(t)?pl(n,t):pl(n,e)}else pl(n,e)}class Ua{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!kt(e))return!1;const t=this._nodes,r=e._nodes;return t.size===r.size&&Array.from(t).every(i=>r.has(i))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new Ua(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),r=t.length,i=t[r-1];let o;if(pe(i))o=i.select();else{const s=i.getIndexWithinParent()+1;o=i.getParentOrThrow().select(s,s)}o.insertNodes(e);for(let s=0;s<r;s++)t[s].remove()}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this._nodes,r=[];for(const i of t){const o=yt(i);o!==null&&r.push(o)}return ds()||(this._cachedNodes=r),r}getTextContent(){const e=this.getNodes();let t="";for(let r=0;r<e.length;r++)t+=e[r].getTextContent();return t}deleteNodes(){const e=this.getNodes();if((fe()||yo())===this&&e[0]){const t=Yt(e[0],"next");w2(Br(t,t))}for(const t of e)t.remove()}}function ae(n){return n instanceof yi}class yi{format;style;anchor;focus;_cachedNodes;dirty;constructor(e,t,r,i){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=r,this.style=i,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!ae(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=(function(r){const i=[],[o,s]=r.getTextSlices();o&&i.push(o.caret.origin);const a=new Set,u=new Set;for(const c of r)if(tr(c)){const{origin:d}=c;i.length===0?a.add(d):(u.add(d),i.push(d))}else{const{origin:d}=c;oe(d)&&u.has(d)||i.push(d)}if(s&&i.push(s.caret.origin),ao(r.focus)&&oe(r.focus.origin)&&r.focus.getNodeAtCaret()===null)for(let c=Un(r.focus.origin,"previous");tr(c)&&a.has(c.origin)&&!c.origin.isEmpty()&&c.origin.is(i[i.length-1]);c=Oc(c))a.delete(c.origin),i.pop();for(;i.length>1;){const c=i[i.length-1];if(!oe(c)||u.has(c)||c.isEmpty()||a.has(c))break;i.pop()}if(i.length===0&&r.isCollapsed()){const c=Sn(r.anchor),d=Sn(r.anchor.getFlipped()),f=p=>Dr(p)?p.origin:p.getNodeAtCaret(),g=f(c)||f(d)||(r.anchor.getNodeAtCaret()?c.origin:d.origin);i.push(g)}return i})(tp(cf(this),"next"));return ds()||(this._cachedNodes=t),t}setTextNodeRange(e,t,r,i){this.anchor.set(e.__key,t,"text"),this.focus.set(r.__key,i,"text")}getTextContent(){const e=this.getNodes();if(e.length===0)return"";const t=e[0],r=e[e.length-1],i=this.anchor,o=this.focus,s=i.isBefore(o),[a,u]=mu(this);let c="",d=!0;for(let f=0;f<e.length;f++){const g=e[f];if(oe(g)&&!g.isInline())d||(c+=`
|
|
22
|
-
`),d=!g.isEmpty();else if(d=!1,pe(g)){let p=g.getTextContent();g===t?g===r?i.type==="element"&&o.type==="element"&&o.offset!==i.offset||(p=a<u?p.slice(a,u):p.slice(u,a)):p=s?p.slice(a):p.slice(u):g===r&&(p=s?p.slice(0,u):p.slice(0,a)),c+=p}else!rt(g)&&!Gi(g)||g===r&&this.isCollapsed()||(c+=g.getTextContent())}return c}applyDOMRange(e){const t=ct(),r=t.getEditorState()._selection,i=Ev(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,r);if(i===null)return;const[o,s]=i;this.anchor.set(o.key,o.offset,o.type,!0),this.focus.set(s.key,s.offset,s.type,!0),ro(this)}clone(){const e=this.anchor,t=this.focus;return new yi(sr(e.key,e.offset,e.type),sr(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=ma(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=oi[e];return(this.format&t)!==0}insertRawText(e){const t=e.split(/(\r?\n|\t)/),r=[],i=t.length;for(let o=0;o<i;o++){const s=t[o];s===`
|
|
23
|
-
`||s===`\r
|
|
24
|
-
`?r.push(wr()):s===" "?r.push(bo()):r.push(Bt(s))}this.insertNodes(r)}insertText(e){const t=this.anchor,r=this.focus,i=this.format,o=this.style;let s=t,a=r;!this.isCollapsed()&&r.isBefore(t)&&(s=r,a=t),s.type==="element"&&(function(h,x,_,S){const k=h.getNode(),b=k.getChildAtIndex(h.offset),C=Bt();if(C.setFormat(_),C.setStyle(S),pc(b))b.splice(0,0,[C]);else{const T=Rt(k)?xt().append(C):C;b===null?k.append(T):b.insertBefore(T)}h.is(x)&&x.set(C.__key,0,"text"),h.set(C.__key,0,"text")})(s,a,i,o),a.type==="element"&&fi(a,Sn(Sr(a,"next")));const u=s.offset;let c=a.offset;const d=this.getNodes(),f=d.length;let g=d[0];pe(g)||le(26);const p=g.getTextContent().length,v=g.getParentOrThrow();let m=d[f-1];if(f===1&&a.type==="element"&&(c=p,a.set(s.key,c,"text")),this.isCollapsed()&&u===p&&(hr(g)||!g.canInsertTextAfter()||!v.canInsertTextAfter()&&g.getNextSibling()===null)){let h=g.getNextSibling();if(pe(h)&&h.canInsertTextBefore()&&!hr(h)||(h=Bt(),h.setFormat(i),h.setStyle(o),v.canInsertTextAfter()?g.insertAfter(h):v.insertAfter(h)),h.select(0,0),g=h,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&u===0&&(hr(g)||!g.canInsertTextBefore()||!v.canInsertTextBefore()&&g.getPreviousSibling()===null)){let h=g.getPreviousSibling();if(pe(h)&&!hr(h)||(h=Bt(),h.setFormat(i),v.canInsertTextBefore()?g.insertBefore(h):v.insertBefore(h)),h.select(),g=h,e!=="")return void this.insertText(e)}else if(g.isSegmented()&&u!==p){const h=Bt(g.getTextContent());h.setFormat(i),g.replace(h),g=h}else if(!this.isCollapsed()&&e!==""){const h=m.getParent();if(!v.canInsertTextBefore()||!v.canInsertTextAfter()||oe(h)&&(!h.canInsertTextBefore()||!h.canInsertTextAfter()))return this.insertText(""),Cv(this.anchor,this.focus,null),void this.insertText(e)}if(f===1){if(ni(g)){const S=Bt(e);return S.select(),void g.replace(S)}const h=g.getFormat(),x=g.getStyle();if(u!==c||h===i&&x===o){if(Ba(g)){const S=Bt(e);return S.setFormat(i),S.setStyle(o),S.select(),void g.replace(S)}}else{if(g.getTextContent()!==""){const S=Bt(e);if(S.setFormat(i),S.setStyle(o),S.select(),u===0)g.insertBefore(S,!1);else{const[k]=g.splitText(u);k.insertAfter(S,!1)}return void(S.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}g.setFormat(i),g.setStyle(o)}const _=c-u;g=g.spliceText(u,_,e,!0),g.getTextContent()===""?g.remove():this.anchor.type==="text"&&(g.isComposing()?this.anchor.offset-=e.length:(this.format=h,this.style=x))}else{const h=new Set([...g.getParentKeys(),...m.getParentKeys()]),x=oe(g)?g:g.getParentOrThrow();let _=oe(m)?m:m.getParentOrThrow(),S=m;if(!x.is(_)&&_.isInline())do S=_,_=_.getParentOrThrow();while(_.isInline());if(a.type==="text"&&(c!==0||m.getTextContent()==="")||a.type==="element"&&m.getIndexWithinParent()<c)if(pe(m)&&!ni(m)&&c!==m.getTextContentSize()){if(m.isSegmented()){const O=Bt(m.getTextContent());m.replace(O),m=O}Rt(a.getNode())||a.type!=="text"||(m=m.spliceText(0,c,"")),h.add(m.__key)}else{const O=m.getParentOrThrow();O.canBeEmpty()||O.getChildrenSize()!==1?m.remove():O.remove()}else h.add(m.__key);const k=_.getChildren(),b=new Set(d),C=x.is(_),T=x.isInline()&&g.getNextSibling()===null?x:g;for(let O=k.length-1;O>=0;O--){const E=k[O];if(E.is(g)||oe(E)&&E.isParentOf(g))break;E.isAttached()&&(!b.has(E)||E.is(S)?C||T.insertAfter(E,!1):E.remove())}if(!C){let O=_,E=null;for(;O!==null;){const D=O.getChildren(),L=D.length;(L===0||D[L-1].is(E))&&(h.delete(O.__key),E=O),O=O.getParent()}}if(ni(g))if(u===p)g.select();else{const O=Bt(e);O.select(),g.replace(O)}else g=g.spliceText(u,p-u,e,!0),g.getTextContent()===""?g.remove():this.anchor.type==="text"&&(g.isComposing()?this.anchor.offset-=e.length:(this.format=g.getFormat(),this.style=g.getStyle()));for(let O=1;O<f;O++){const E=d[O],D=E.__key;h.has(D)||E.remove()}}}removeText(){const e=fe()===this;qs(this,S2(cf(this))),e&&fe()!==this&&Qt(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void qt(null);const r=this.getNodes(),i=[];for(const k of r)pe(k)&&i.push(k);const o=k=>{r.forEach(b=>{if(oe(b)){const C=b.getFormatFlags(e,k);b.setTextFormat(C)}})},s=i.length;if(s===0)return this.toggleFormat(e),qt(null),void o(t);const a=this.anchor,u=this.focus,c=this.isBackward(),d=c?u:a,f=c?a:u;let g=0,p=i[0],v=d.type==="element"?0:d.offset;if(d.type==="text"&&v===p.getTextContentSize()&&(g=1,p=i[1],v=0),p==null)return;const m=p.getFormatFlags(e,t);o(m);const h=s-1;let x=i[h];const _=f.type==="text"?f.offset:x.getTextContentSize();if(p.is(x)){if(v===_)return;if(hr(p)||v===0&&_===p.getTextContentSize())p.setFormat(m);else{const k=p.splitText(v,_),b=v===0?k[0]:k[1];b.setFormat(m),d.type==="text"&&d.set(b.__key,0,"text"),f.type==="text"&&f.set(b.__key,_-v,"text")}return void(this.format=m)}v===0||hr(p)||([,p]=p.splitText(v),v=0),p.setFormat(m);const S=x.getFormatFlags(e,m);_>0&&(_===x.getTextContentSize()||hr(x)||([x]=x.splitText(_)),x.setFormat(S));for(let k=g+1;k<h;k++){const b=i[k],C=b.getFormatFlags(e,S);b.setFormat(C)}d.type==="text"&&d.set(p.__key,v,"text"),f.type==="text"&&f.set(x.__key,_,"text"),this.format=m|S}insertNodes(e){if(e.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();const v=fe();return ae(v)||le(134),v.insertNodes(e)}const t=(this.isBackward()?this.focus:this.anchor).getNode(),r=on(t,xn),i=e[e.length-1];if(oe(r)&&"__language"in r){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const v=ml(this);r.splice(v,0,e),i.selectEnd()}return}if(!e.some(v=>(oe(v)||rt(v))&&!v.isInline())){oe(r)||le(211,t.constructor.name,t.getType());const v=ml(this);return r.splice(v,0,e),void i.selectEnd()}const o=(function(v){const m=xt();let h=null;for(let x=0;x<v.length;x++){const _=v[x],S=Gi(_);if(S||rt(_)&&_.isInline()||oe(_)&&_.isInline()||pe(_)||_.isParentRequired()){if(h===null&&(h=_.createParentElementNode(),m.append(h),S))continue;h!==null&&h.append(_)}else m.append(_),h=null}return m})(e),s=o.getLastDescendant(),a=o.getChildren(),u=!oe(r)||!r.isEmpty()?this.insertParagraph():null,c=a[a.length-1];let d=a[0];var f;oe(f=d)&&xn(f)&&!f.isEmpty()&&oe(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(oe(r)||le(211,t.constructor.name,t.getType()),r.append(...d.getChildren()),d=a[1]),d&&(r===null&&le(212,t.constructor.name,t.getType()),(function(v,m){const h=m.getParentOrThrow().getLastChild();let x=m;const _=[m];for(;x!==h;)x.getNextSibling()||le(140),x=x.getNextSibling(),_.push(x);let S=v;for(const k of _)S=S.insertAfter(k)})(r,d));const g=on(s,xn);u&&oe(g)&&(u.canMergeWhenEmpty()||xn(c))&&(g.append(...u.getChildren()),u.remove()),oe(r)&&r.isEmpty()&&r.remove(),s.selectEnd();const p=oe(r)?r.getLastChild():null;Gi(p)&&g!==r&&p.remove()}insertParagraph(){if(this.anchor.key==="root"){const s=xt();return Mt().splice(this.anchor.offset,0,[s]),s.select(),s}const e=ml(this),t=on(this.anchor.getNode(),xn);oe(t)||le(213);const r=t.getChildAtIndex(e),i=r?[r,...r.getNextSiblings()]:[],o=t.insertNewAfter(this,!1);return o?(o.append(...i),o.selectStart(),o):null}insertLineBreak(e){const t=wr();if(this.insertNodes([t]),e){const r=t.getParentOrThrow(),i=t.getIndexWithinParent();r.select(i,i)}}extract(){const e=[...this.getNodes()],t=e.length;let r=e[0],i=e[t-1];const[o,s]=mu(this),a=this.isBackward(),[u,c]=a?[this.focus,this.anchor]:[this.anchor,this.focus],[d,f]=a?[s,o]:[o,s];if(t===0)return[];if(t===1){if(pe(r)&&!this.isCollapsed()){const g=r.splitText(d,f),p=d===0?g[0]:g[1];return p?(u.set(p.getKey(),0,"text"),c.set(p.getKey(),p.getTextContentSize(),"text"),[p]):[]}return[r]}if(pe(r)&&(d===r.getTextContentSize()?e.shift():d!==0&&([,r]=r.splitText(d),e[0]=r,u.set(r.getKey(),0,"text"))),pe(i)){const g=i.getTextContent().length;f===0?e.pop():f!==g&&([i]=i.splitText(f),e[e.length-1]=i,c.set(i.getKey(),i.getTextContentSize(),"text"))}return e}modify(e,t,r){if(Vd(this,e,t,r))return;const i=e==="move",o=ct(),s=Kn(Pn(o));if(!s)return;const a=o._blockCursorElement,u=o._rootElement,c=this.focus.getNode();if(u===null||a===null||!oe(c)||c.isInline()||c.canBeEmpty()||wu(a,o,u),this.dirty){let d=li(o,this.anchor.key),f=li(o,this.focus.key);this.anchor.type==="text"&&(d=oo(d)),this.focus.type==="text"&&(f=oo(f)),d&&f&&Nv(s,d,this.anchor.offset,f,this.focus.offset)}if((function(d,f,g,p){d.modify(f,g,p)})(s,e,t?"backward":"forward",r),s.rangeCount>0){const d=s.getRangeAt(0),f=this.anchor.getNode(),g=Rt(f)?f:a2(f);if(this.applyDOMRange(d),this.dirty=!0,!i){const p=this.getNodes(),v=[];let m=!1;for(let h=0;h<p.length;h++){const x=p[h];xu(x,g)?v.push(x):m=!0}if(m&&v.length>0)if(t){const h=v[0];oe(h)?h.selectStart():h.getParentOrThrow().selectStart()}else{const h=v[v.length-1];oe(h)?h.selectEnd():h.getParentOrThrow().selectEnd()}s.anchorNode===d.startContainer&&s.anchorOffset===d.startOffset||(function(h){const x=h.focus,_=h.anchor,S=_.key,k=_.offset,b=_.type;_.set(x.key,x.offset,x.type,!0),x.set(S,k,b,!0)})(this)}}r==="lineboundary"&&Vd(this,e,t,r,"decorators")}forwardDeletion(e,t,r){if(!r&&(e.type==="element"&&oe(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){const i=t.getParent(),o=t.getNextSibling()||(i===null?null:i.getNextSibling());if(oe(o)&&o.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let i=r.getNode();if(this.forwardDeletion(r,i,e))return;const o=Pc(Sr(r,e?"previous":"next"));if(o.getTextSlices().every(a=>a===null||a.distance===0)){let a={type:"initial"};for(const u of o.iterNodeCarets("shadowRoot"))if(tr(u)){if(!u.origin.isInline()){if(u.origin.isShadowRoot()){if(a.type==="merge-block")break;if(oe(o.anchor.origin)&&o.anchor.origin.isEmpty()){const c=Sn(u);qs(this,Br(c,c)),o.anchor.origin.remove()}return}a.type!=="merge-next-block"&&a.type!=="merge-block"||(a={block:a.block,caret:u,type:"merge-block"})}}else{if(a.type==="merge-block")break;if(ao(u)){if(oe(u.origin)){if(u.origin.isInline()){if(!u.origin.isParentOf(o.anchor.origin))break}else a={block:u.origin,type:"merge-next-block"};continue}if(rt(u.origin)){if(!u.origin.isIsolated())if(a.type==="merge-next-block"&&(u.origin.isKeyboardSelectable()||!u.origin.isInline())&&oe(o.anchor.origin)&&o.anchor.origin.isEmpty()){o.anchor.origin.remove();const c=dc();c.add(u.origin.getKey()),Qt(c)}else u.origin.remove();return}break}}if(a.type==="merge-block"){const{caret:u,block:c}=a;return qs(this,Br(!u.origin.isEmpty()&&c.isEmpty()?Dc(Yt(c,u.direction)):o.anchor,u)),this.removeText()}}const s=this.focus;if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&r.offset===0&&Bd(this,r.getNode()))return}else{const a=s.type==="text"?s.getNode():null;if(i=r.type==="text"?r.getNode():null,a!==null&&a.isSegmented()){const u=s.offset,c=a.getTextContentSize();if(a.is(i)||e&&u!==c||!e&&u!==0)return void Ud(a,e,u)}else if(i!==null&&i.isSegmented()){const u=r.offset,c=i.getTextContentSize();if(i.is(a)||e&&u!==0||!e&&u!==c)return void Ud(i,e,u)}(function(u,c){const d=u.anchor,f=u.focus,g=d.getNode(),p=f.getNode();if(g===p&&d.type==="text"&&f.type==="text"){const v=d.offset,m=f.offset,h=v<m,x=h?v:m,_=h?m:v,S=_-1;x!==S&&(function(k){return!(Hv(k)||Jw(k))})(g.getTextContent().slice(x,_))&&(c?f.set(f.key,S,f.type):d.set(d.key,S,d.type))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&Rt(r.getParent())&&r.getPreviousSibling()===null&&Bd(this,r)}}deleteLine(e){this.isCollapsed()&&this.modify("extend",e,"lineboundary"),this.isCollapsed()?this.deleteCharacter(e):this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,r=t.getNode();if(this.forwardDeletion(t,r,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function kt(n){return n instanceof Ua}function zd(n){const e=n.offset;if(n.type==="text")return e;const t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function mu(n){const e=n.getStartEndPoints();if(e===null)return[0,0];const[t,r]=e;return t.type==="element"&&r.type==="element"&&t.key===r.key&&t.offset===r.offset?[0,0]:[zd(t),zd(r)]}function Bd(n,e){for(let t=e;t;t=t.getParent()){if(oe(t)){if(t.collapseAtStart(n))return!0;if(cn(t))break}if(t.getPreviousSibling())break}return!1}const Jw=(()=>{try{const n=new RegExp("\\p{Emoji}","u"),e=n.test.bind(n);if(e("❤️")&&e("#️⃣")&&e("👍"))return e}catch{}return()=>!1})();function Ud(n,e,t){const r=n,i=r.getTextContent().split(/(?=\s)/g),o=i.length;let s=0,a=0;for(let c=0;c<o;c++){const d=c===o-1;if(a=s,s+=i[c].length,e&&s===t||s>t||d){i.splice(c,1),d&&(a=void 0);break}}const u=i.join("").trim();u===""?r.remove():(r.setTextContent(u),r.select(a,a))}function jd(n,e,t,r){let i,o=e;if(Ft(n)){let s=!1;const a=n.childNodes,u=a.length,c=r._blockCursorElement;o===u&&(s=!0,o=u-1);let d=a[o],f=!1;if(d===c)d=a[o+1],f=!0;else if(c!==null){const g=c.parentNode;n===g&&e>Array.prototype.indexOf.call(g.children,c)&&o--}if(i=zi(d),pe(i))o=Fr(i,s?"next":"previous");else{let g=zi(n);if(g===null)return null;if(oe(g)){const p=r.getElementByKey(g.getKey());p===null&&le(214),[g,o]=g.getDOMSlot(p).resolveChildIndex(g,p,n,e),oe(g)||le(215),s&&o>=g.getChildrenSize()&&(o=Math.max(0,g.getChildrenSize()-1));let m=g.getChildAtIndex(o);if(oe(m)&&(function(h,x,_){const S=h.getParent();return _===null||S===null||!S.canBeEmpty()||S!==_.getNode()})(m,0,t)){const h=s?m.getLastDescendant():m.getFirstDescendant();h===null?g=m:(m=h,g=oe(m)?m:m.getParentOrThrow()),o=0}pe(m)?(i=m,g=null,o=Fr(m,s?"next":"previous")):m!==g&&s&&!f&&(oe(g)||le(216),o=Math.min(g.getChildrenSize(),o+1))}else{const p=g.getIndexWithinParent();o=e===0&&rt(g)&&zi(n)===g?p:p+1,g=g.getParentOrThrow()}if(oe(g))return sr(g.__key,o,"element")}}else i=zi(n);return pe(i)?sr(i.__key,Fr(i,o,"clamp"),"text"):null}function Wd(n,e,t){const r=n.offset,i=n.getNode();if(r===0){const o=i.getPreviousSibling(),s=i.getParent();if(e){if((t||!e)&&o===null&&oe(s)&&s.isInline()){const a=s.getPreviousSibling();pe(a)&&n.set(a.__key,a.getTextContent().length,"text")}}else oe(o)&&!t&&o.isInline()?n.set(o.__key,o.getChildrenSize(),"element"):pe(o)&&n.set(o.__key,o.getTextContent().length,"text")}else if(r===i.getTextContent().length){const o=i.getNextSibling(),s=i.getParent();if(e&&oe(o)&&o.isInline())n.set(o.__key,0,"element");else if((t||e)&&o===null&&oe(s)&&s.isInline()&&!s.canInsertTextAfter()){const a=s.getNextSibling();pe(a)&&n.set(a.__key,0,"text")}}}function Cv(n,e,t){if(n.type==="text"&&e.type==="text"){const r=n.isBefore(e),i=n.is(e);Wd(n,r,i),Wd(e,!r,i),i&&e.set(n.key,n.offset,n.type);const o=ct();if(o.isComposing()&&o._compositionKey!==n.key&&ae(t)){const s=t.anchor,a=t.focus;n.set(s.key,s.offset,s.type,!0),e.set(a.key,a.offset,a.type,!0)}}}function Ev(n,e,t,r,i,o){if(n===null||t===null||!gs(i,n,t))return null;const s=jd(n,e,ae(o)?o.anchor:null,i);if(s===null)return null;const a=jd(t,r,ae(o)?o.focus:null,i);if(a===null)return null;if(s.type==="element"&&a.type==="element"){const u=zi(n),c=zi(t);if(rt(u)&&rt(c))return null}return Cv(s,a,o),[s,a]}function _u(n){return oe(n)&&!n.isInline()}function Tv(n,e,t,r,i,o){const s=Wr(),a=new yi(sr(n,e,i),sr(t,r,o),0,"");return a.dirty=!0,s._selection=a,a}function cc(){const n=sr("root",0,"element"),e=sr("root",0,"element");return new yi(n,e,0,"")}function dc(){return new Ua(new Set)}function fc(n,e,t,r){const i=t._window;if(i===null)return null;const o=r||i.event,s=o?o.type:void 0,a=s==="selectionchange",u=!$l&&(a||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&o&&o.detail===3||s==="drop"||s===void 0);let c,d,f,g;if(ae(n)&&!u)return n.clone();if(e===null)return null;if(c=e.anchorNode,d=e.focusNode,f=e.anchorOffset,g=e.focusOffset,(a||s===void 0)&&ae(n)&&!gs(t,c,d))return n.clone();const p=Ev(c,f,d,g,t,n);if(p===null)return null;const[v,m]=p;return new yi(v,m,ae(n)?n.format:0,ae(n)?n.style:"")}function fe(){return Wr()._selection}function yo(){return ct()._editorState._selection}function va(n,e,t,r=1){const i=n.anchor,o=n.focus,s=i.getNode(),a=o.getNode();if(!e.is(s)&&!e.is(a))return;const u=e.__key;if(n.isCollapsed()){const c=i.offset;if(t<=c&&r>0||t<c&&r<0){const d=Math.max(0,c+r);i.set(u,d,"element"),o.set(u,d,"element"),Kd(n)}}else{const c=n.isBackward(),d=c?o:i,f=d.getNode(),g=c?i:o,p=g.getNode();if(e.is(f)){const v=d.offset;(t<=v&&r>0||t<v&&r<0)&&d.set(u,Math.max(0,v+r),"element")}if(e.is(p)){const v=g.offset;(t<=v&&r>0||t<v&&r<0)&&g.set(u,Math.max(0,v+r),"element")}}Kd(n)}function Kd(n){const e=n.anchor,t=e.offset,r=n.focus,i=r.offset,o=e.getNode(),s=r.getNode();if(n.isCollapsed()){if(!oe(o))return;const a=o.getChildrenSize(),u=t>=a,c=u?o.getChildAtIndex(a-1):o.getChildAtIndex(t);if(pe(c)){let d=0;u&&(d=c.getTextContentSize()),e.set(c.__key,d,"text"),r.set(c.__key,d,"text")}return}if(oe(o)){const a=o.getChildrenSize(),u=t>=a,c=u?o.getChildAtIndex(a-1):o.getChildAtIndex(t);if(pe(c)){let d=0;u&&(d=c.getTextContentSize()),e.set(c.__key,d,"text")}}if(oe(s)){const a=s.getChildrenSize(),u=i>=a,c=u?s.getChildAtIndex(a-1):s.getChildAtIndex(i);if(pe(c)){let d=0;u&&(d=c.getTextContentSize()),r.set(c.__key,d,"text")}}}function pa(n,e,t,r,i){let o=null,s=0,a=null;r!==null?(o=r.__key,pe(r)?(s=r.getTextContentSize(),a="text"):oe(r)&&(s=r.getChildrenSize(),a="element")):i!==null&&(o=i.__key,pe(i)?a="text":oe(i)&&(a="element")),o!==null&&a!==null?n.set(o,s,a):(s=e.getIndexWithinParent(),s===-1&&(s=t.getChildrenSize()),n.set(t.__key,s,"element"))}function Hd(n,e,t,r,i){n.type==="text"?n.set(t,n.offset+(e?0:i),"text"):n.offset>r.getIndexWithinParent()&&n.set(n.key,n.offset-1,"element")}function Nv(n,e,t,r,i){try{n.setBaseAndExtent(e,t,r,i)}catch{}}function qw(n,e,t,r,i,o,s){const a=r.anchorNode,u=r.focusNode,c=r.anchorOffset,d=r.focusOffset,f=document.activeElement;if(i.has(Lw)&&f!==o||f!==null&&yc(f))return;if(!ae(e))return void(n!==null&&gs(t,a,u)&&r.removeAllRanges());const g=e.anchor,p=e.focus,v=g.key,m=p.key,h=li(t,v),x=li(t,m),_=g.offset,S=p.offset,k=e.format,b=e.style,C=e.isCollapsed();let T=h,O=x,E=!1;if(g.type==="text"){T=oo(h);const P=g.getNode();E=P.getFormat()!==k||P.getStyle()!==b}else ae(n)&&n.anchor.type==="text"&&(E=!0);var D,L,V,J,R;if(p.type==="text"&&(O=oo(x)),T!==null&&O!==null&&(C&&(n===null||E||ae(n)&&(n.format!==k||n.style!==b))&&(D=k,L=b,V=_,J=v,R=performance.now(),pv=[D,L,V,J,R]),c!==_||d!==S||a!==T||u!==O||r.type==="Range"&&C||(f!==null&&o.contains(f)||i.has(Dd)||o.focus({preventScroll:!0}),g.type==="element"))){if(Nv(r,T,_,O,S),!zr||!e.isCollapsed()||o===null||i.has(Dd)||document.activeElement!==null&&o.contains(document.activeElement)||o.focus({preventScroll:!0}),!i.has(Rw)&&e.isCollapsed()&&o!==null&&o===document.activeElement){const P=ae(e)&&e.anchor.type==="element"?T.childNodes[_]||null:r.rangeCount>0?r.getRangeAt(0):null;if(P!==null){let K;if(P instanceof Text){const Q=document.createRange();Q.selectNode(P),K=Q.getBoundingClientRect()}else K=P.getBoundingClientRect();(function(Q,ee,H){const j=Gv(H),ne=Ec(j);if(j===null||ne===null)return;let{top:B,bottom:z}=ee,F=0,I=0,Y=H;for(;Y!==null;){const ie=Y===j.body;if(ie)F=0,I=Pn(Q).innerHeight;else{const we=Y.getBoundingClientRect();F=we.top,I=we.bottom}let ue=0;if(B<F?ue=-(F-B):z>I&&(ue=z-I),ue!==0)if(ie)ne.scrollBy(0,ue);else{const we=Y.scrollTop;Y.scrollTop+=ue;const me=Y.scrollTop-we;B-=me,z-=me}if(ie)break;Y=hs(Y)}})(t,K,o)}}du=!0}}function Ii(n){let e=fe()||yo();e===null&&(e=Mt().selectEnd()),e.insertNodes(n)}function ml(n){let e=n;n.isCollapsed()||e.removeText();const t=fe();ae(t)&&(e=t),ae(e)||le(161);const r=e.anchor;let i=r.getNode(),o=r.offset;for(;!xn(i);){const s=i;if([i,o]=Gw(i,o),s.is(i))break}return o}function Gw(n,e){const t=n.getParent();if(!t){const i=xt();return Mt().append(i),i.select(),[Mt(),0]}if(pe(n)){const i=n.splitText(e);if(i.length===0)return[t,n.getIndexWithinParent()];const o=e===0?0:1;return[t,i[0].getIndexWithinParent()+o]}if(!oe(n)||e===0)return[t,n.getIndexWithinParent()];const r=n.getChildAtIndex(e);if(r){const i=new yi(sr(n.__key,e,"element"),sr(n.__key,e,"element"),0,""),o=n.insertNewAfter(i);o&&o.append(r,...r.getNextSiblings())}return[t,n.getIndexWithinParent()+1]}function Vd(n,e,t,r,i="decorators-and-blocks"){if(e==="move"&&r==="character"&&!n.isCollapsed()){const[d,f]=t===n.isBackward()?[n.focus,n.anchor]:[n.anchor,n.focus];return f.set(d.key,d.offset,d.type),!0}const o=Sr(n.focus,t?"previous":"next"),s=r==="lineboundary",a=e==="move";let u=o,c=i==="decorators-and-blocks";if(!ep(u)){for(const d of u){c=!1;const{origin:f}=d;if(!rt(f)||f.isIsolated()||(u=d,!s||!f.isInline()))break}if(c)for(const d of Pc(o).iterNodeCarets(e==="extend"?"shadowRoot":"root")){if(tr(d))d.origin.isInline()||(u=d);else{if(oe(d.origin))continue;rt(d.origin)&&!d.origin.isInline()&&(u=d)}break}}if(u===o)return!1;if(a&&!s&&rt(u.origin)&&u.origin.isKeyboardSelectable()){const d=dc();return d.add(u.origin.getKey()),Qt(d),!0}return u=Sn(u),a&&fi(n.anchor,u),fi(n.focus,u),c||!s}let Ut=null,jt=null,un=!1,_l=!1,Vs=0;const Jd={characterData:!0,childList:!0,subtree:!0};function ds(){return un||Ut!==null&&Ut._readOnly}function Jt(){un&&le(13)}function Av(){Vs>99&&le(14)}function Wr(){return Ut===null&&le(195,Ov()),Ut}function ct(){return jt===null&&le(196,Ov()),jt}function Ov(){let n=0;const e=new Set,t=io.version;if(typeof window<"u")for(const i of document.querySelectorAll("[contenteditable]")){const o=Wa(i);if(xc(o))n++;else if(o){let s=String(o.constructor.version||"<0.17.1");s===t&&(s+=" (separately built, likely a bundler configuration issue)"),e.add(s)}}let r=` Detected on the page: ${n} compatible editor(s) with version ${t}`;return e.size&&(r+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),r}function Yw(){return jt}function qd(n,e,t){const r=e.__type,i=Lv(n,r);let o=t.get(r);o===void 0&&(o=Array.from(i.transforms),t.set(r,o));const s=o.length;for(let a=0;a<s&&(o[a](e),e.isAttached());a++);}function Gd(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function Mv(n,e){if(!e)return;const t=n._updateTags;let r=e;Array.isArray(e)||(r=[e]);for(const i of r)t.add(i)}function Zw(n){return gc(n,ct()._nodes)}function gc(n,e){const t=n.type,r=e.get(t);r===void 0&&le(17,t);const i=r.klass;n.type!==i.getType()&&le(18,i.name);const o=i.importJSON(n),s=n.children;if(oe(o)&&Array.isArray(s))for(let a=0;a<s.length;a++){const u=gc(s[a],e);o.append(u)}return o}function Yd(n,e,t){const r=Ut,i=un,o=jt;Ut=e,un=!0,jt=n;try{return t()}finally{Ut=r,un=i,jt=o}}function vr(n,e){const t=n._pendingEditorState,r=n._rootElement,i=n._headless||r===null;if(t===null)return;const o=n._editorState,s=o._selection,a=t._selection,u=n._dirtyType!==0,c=Ut,d=un,f=jt,g=n._updating,p=n._observer;let v=null;if(n._pendingEditorState=null,n._editorState=t,!i&&u&&p!==null){jt=n,Ut=t,un=!1,n._updating=!0;try{const C=n._dirtyType,T=n._dirtyElements,O=n._dirtyLeaves;p.disconnect(),v=pw(o,t,n,C,T,O)}catch(C){if(C instanceof Error&&n._onError(C),_l)throw C;return Iv(n,null,r,t),Vh(n),n._dirtyType=2,_l=!0,vr(n,o),void(_l=!1)}finally{p.observe(r,Jd),n._updating=g,Ut=c,un=d,jt=f}}t._readOnly||(t._readOnly=!0);const m=n._dirtyLeaves,h=n._dirtyElements,x=n._normalizedNodes,_=n._updateTags,S=n._deferred;u&&(n._dirtyType=0,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),(function(C,T){const O=C._decorators;let E=C._pendingDecorators||O;const D=T._nodeMap;let L;for(L in E)D.has(L)||(E===O&&(E=Wv(C)),delete E[L])})(n,t);const k=i?null:Kn(Pn(n));if(n._editable&&k!==null&&(u||a===null||a.dirty||!a.is(s))&&r!==null&&!_.has(zw)){jt=n,Ut=t;try{if(p!==null&&p.disconnect(),u||a===null||a.dirty){const C=n._blockCursorElement;C!==null&&wu(C,n,r),qw(s,a,n,k,_,r)}(function(C,T,O){let E=C._blockCursorElement;if(ae(O)&&O.isCollapsed()&&O.anchor.type==="element"&&T.contains(document.activeElement)){const D=O.anchor,L=D.getNode(),V=D.offset;let J=!1,R=null;if(V===L.getChildrenSize())yl(L.getChildAtIndex(V-1))&&(J=!0);else{const P=L.getChildAtIndex(V);if(P!==null&&yl(P)){const K=P.getPreviousSibling();(K===null||yl(K))&&(J=!0,R=C.getElementByKey(P.__key))}}if(J){const P=C.getElementByKey(L.__key);return E===null&&(C._blockCursorElement=E=(function(K){const Q=K.theme,ee=document.createElement("div");ee.contentEditable="false",ee.setAttribute("data-lexical-cursor","true");let H=Q.blockCursor;if(H!==void 0){if(typeof H=="string"){const j=Ur(H);H=Q.blockCursor=j}H!==void 0&&ee.classList.add(...H)}return ee})(C._config)),T.style.caretColor="transparent",void(R===null?P.appendChild(E):P.insertBefore(E,R))}}E!==null&&wu(E,C,T)})(n,r,a)}finally{p!==null&&p.observe(r,Jd),jt=f,Ut=c}}v!==null&&(function(C,T,O,E,D){const L=Array.from(C._listeners.mutation),V=L.length;for(let J=0;J<V;J++){const[R,P]=L[J];for(const K of P){const Q=T.get(K);Q!==void 0&&R(Q,{dirtyLeaves:E,prevEditorState:D,updateTags:O})}}})(n,v,_,m,o),ae(a)||a===null||s!==null&&s.is(a)||n.dispatchCommand(Da,void 0);const b=n._pendingDecorators;b!==null&&(n._decorators=b,n._pendingDecorators=null,Ro("decorator",n,!0,b)),(function(C,T,O){const E=$d(T),D=$d(O);E!==D&&Ro("textcontent",C,!0,D)})(n,e||o,t),Ro("update",n,!0,{dirtyElements:h,dirtyLeaves:m,editorState:t,mutatedNodes:v,normalizedNodes:x,prevEditorState:e||o,tags:_}),(function(C,T){if(C._deferred=[],T.length!==0){const O=C._updating;C._updating=!0;try{for(let E=0;E<T.length;E++)T[E]()}finally{C._updating=O}}})(n,S),(function(C){const T=C._updates;if(T.length!==0){const O=T.shift();if(O){const[E,D]=O;ja(C,E,D)}}})(n)}function Ro(n,e,t,...r){const i=e._updating;e._updating=t;try{const o=Array.from(e._listeners[n]);for(let s=0;s<o.length;s++)o[s].apply(null,r)}finally{e._updating=i}}function Zd(n,e){const t=n._updates;let r=e||!1;for(;t.length!==0;){const i=t.shift();if(i){const[o,s]=i,a=n._pendingEditorState;let u;s!==void 0&&(u=s.onUpdate,s.skipTransforms&&(r=!0),s.discrete&&(a===null&&le(191),a._flushSync=!0),u&&n._deferred.push(u),Mv(n,s.tag)),a==null?ja(n,o,s):o()}}return r}function ja(n,e,t){const r=n._updateTags;let i,o=!1,s=!1;t!==void 0&&(i=t.onUpdate,Mv(n,t.tag),o=t.skipTransforms||!1,s=t.discrete||!1),i&&n._deferred.push(i);const a=n._editorState;let u=n._pendingEditorState,c=!1;(u===null||u._readOnly)&&(u=n._pendingEditorState=Pv(u||a),c=!0),u._flushSync=s;const d=Ut,f=un,g=jt,p=n._updating;Ut=u,un=!1,n._updating=!0,jt=n;const v=n._headless||n.getRootElement()===null;_c(null);try{c&&(v?a._selection!==null&&(u._selection=a._selection.clone()):u._selection=(function(_,S){const k=_.getEditorState()._selection,b=Kn(Pn(_));return ae(k)||k==null?fc(k,b,_,S):k.clone()})(n,t&&t.event||null));const h=n._compositionKey;e(),o=Zd(n,o),(function(_,S){const k=S.getEditorState()._selection,b=_._selection;if(ae(b)){const C=b.anchor,T=b.focus;let O;if(C.type==="text"&&(O=C.getNode(),O.selectionTransform(k,b)),T.type==="text"){const E=T.getNode();O!==E&&E.selectionTransform(k,b)}}})(u,n),n._dirtyType!==0&&(o?(function(_,S){const k=S._dirtyLeaves,b=_._nodeMap;for(const C of k){const T=b.get(C);pe(T)&&T.isAttached()&&T.isSimpleText()&&!T.isUnmergeable()&&kd(T)}})(u,n):(function(_,S){const k=S._dirtyLeaves,b=S._dirtyElements,C=_._nodeMap,T=Nr(),O=new Map;let E=k,D=E.size,L=b,V=L.size;for(;D>0||V>0;){if(D>0){S._dirtyLeaves=new Set;for(const J of E){const R=C.get(J);pe(R)&&R.isAttached()&&R.isSimpleText()&&!R.isUnmergeable()&&kd(R),R!==void 0&&Gd(R,T)&&qd(S,R,O),k.add(J)}if(E=S._dirtyLeaves,D=E.size,D>0){Vs++;continue}}S._dirtyLeaves=new Set,S._dirtyElements=new Map,L.delete("root")&&L.set("root",!0);for(const J of L){const R=J[0],P=J[1];if(b.set(R,P),!P)continue;const K=C.get(R);K!==void 0&&Gd(K,T)&&qd(S,K,O)}E=S._dirtyLeaves,D=E.size,L=S._dirtyElements,V=L.size,Vs++}S._dirtyLeaves=k,S._dirtyElements=b})(u,n),Zd(n),(function(_,S,k,b){const C=_._nodeMap,T=S._nodeMap,O=[];for(const[E]of b){const D=T.get(E);D!==void 0&&(D.isAttached()||(oe(D)&&Wh(D,E,C,T,O,b),C.has(E)||b.delete(E),O.push(E)))}for(const E of O)T.delete(E);for(const E of k){const D=T.get(E);D===void 0||D.isAttached()||(C.has(E)||k.delete(E),T.delete(E))}})(a,u,n._dirtyLeaves,n._dirtyElements)),h!==n._compositionKey&&(u._flushSync=!0);const x=u._selection;if(ae(x)){const _=u._nodeMap,S=x.anchor.key,k=x.focus.key;_.get(S)!==void 0&&_.get(k)!==void 0||le(19)}else kt(x)&&x._nodes.size===0&&(u._selection=null)}catch(h){return h instanceof Error&&n._onError(h),n._pendingEditorState=a,n._dirtyType=2,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void vr(n)}finally{Ut=d,un=f,jt=g,n._updating=p,Vs=0}n._dirtyType!==0||n._deferred.length>0||(function(h,x){const _=x.getEditorState()._selection,S=h._selection;if(S!==null){if(S.dirty||!S.is(_))return!0}else if(_!==null)return!0;return!1})(u,n)?u._flushSync?(u._flushSync=!1,vr(n)):c&&t2(()=>{vr(n)}):(u._flushSync=!1,c&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function er(n,e,t){jt===n&&t===void 0?e():ja(n,e,t)}class zo{element;before;after;constructor(e,t,r){this.element=e,this.before=t||null,this.after=r||null}withBefore(e){return new zo(this.element,e,this.after)}withAfter(e){return new zo(this.element,this.before,e)}withElement(e){return this.element===e?this:new zo(e,this.before,this.after)}insertChild(e){const t=this.before||this.getManagedLineBreak();return t!==null&&t.parentElement!==this.element&&le(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&le(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&le(224),this.element.replaceChild(e,t),this}getFirstChild(){const e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(e===null)this.removeManagedLineBreak();else{const t=e==="decorator"&&(cs||mo||us);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){const e=this.getManagedLineBreak();if(e){const t=this.element,r=e.nodeName==="IMG"?e.nextSibling:null;r&&t.removeChild(r),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){const t=this.getManagedLineBreak();if(t){if(e===(t.nodeName==="IMG"))return;this.removeManagedLineBreak()}const r=this.element,i=this.before,o=document.createElement("br");if(r.insertBefore(o,i),e){const s=document.createElement("img");s.setAttribute("data-lexical-linebreak","true"),s.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",s.alt="",r.insertBefore(s,o),r.__lexicalLineBreak=s}else r.__lexicalLineBreak=o}getFirstChildOffset(){let e=0;for(let t=this.after;t!==null;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,r,i){if(r===this.element){const u=this.getFirstChildOffset();return[e,Math.min(u+e.getChildrenSize(),Math.max(u,i))]}const o=Xd(t,r);o.push(i);const s=Xd(t,this.element);let a=e.getIndexWithinParent();for(let u=0;u<s.length;u++){const c=o[u],d=s[u];if(c===void 0||c<d)break;if(c>d){a+=1;break}}return[e.getParentOrThrow(),a]}}function Xd(n,e){const t=[];let r=e;for(;r!==n&&r!==null;r=r.parentNode){let i=0;for(let o=r.previousSibling;o!==null;o=o.previousSibling)i++;t.push(i)}return r!==n&&le(225),t.reverse()}class bn extends $n{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return sw[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const e=ct()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;t!==null;){if(pe(t)&&e.push(t),oe(t)){const r=t.getAllTextNodes();e.push(...r)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;oe(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;oe(e);){const t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),r=t.length;if(e>=r){const o=t[r-1];return oe(o)&&o.getLastDescendant()||o||null}const i=t[e];return oe(i)&&i.getFirstDescendant()||i||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:yt(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&le(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:yt(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&le(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let r,i;if(e<t/2){for(r=this.getFirstChild(),i=0;r!==null&&i<=e;){if(i===e)return r;r=r.getNextSibling(),i++}return null}for(r=this.getLastChild(),i=t-1;r!==null&&i>=e;){if(i===e)return r;r=r.getPreviousSibling(),i--}return null}getTextContent(){let e="";const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const o=t[i];e+=o.getTextContent(),oe(o)&&i!==r-1&&!o.isInline()&&(e+=Ma)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const o=t[i];e+=o.getTextContentSize(),oe(o)&&i!==r-1&&!o.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==""){const t=pd[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){const t=oi[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return ma(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){Jt();const r=fe();let i=e,o=t;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const u=this.getFirstChild();if(pe(u)||oe(u))return u.select(0,0)}else if(!(e!==void 0&&e!==s||t!==void 0&&t!==s)){const u=this.getLastChild();if(pe(u)||oe(u))return u.select()}}i===void 0&&(i=s),o===void 0&&(o=s);const a=this.__key;return ae(r)?(r.anchor.set(a,i,"element"),r.focus.set(a,o,"element"),r.dirty=!0,r):Tv(a,i,a,o,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach(t=>t.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==""?pd[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,r){ha(this)&&le(324,this.__key,this.__type);const i=this.getChildrenSize(),o=this.getWritable();e+t<=i||le(226,String(e),String(t),String(i));const s=o.__key,a=[],u=[],c=this.getChildAtIndex(e+t);let d=null,f=i-t+r.length;if(e!==0)if(e===i)d=this.getLastChild();else{const p=this.getChildAtIndex(e);p!==null&&(d=p.getPreviousSibling())}if(t>0){let p=d===null?this.getFirstChild():d.getNextSibling();for(let v=0;v<t;v++){p===null&&le(100);const m=p.getNextSibling(),h=p.__key;ri(p.getWritable()),u.push(h),p=m}}let g=d;for(const p of r){g!==null&&p.is(g)&&(d=g=g.getPreviousSibling());const v=p.getWritable();v.__parent===s&&f--,ri(v);const m=p.__key;if(g===null)o.__first=m,v.__prev=null;else{const h=g.getWritable();h.__next=m,v.__prev=h.__key}p.__key===s&&le(76),v.__parent=s,a.push(m),g=p}if(e+t===i)g!==null&&(g.getWritable().__next=null,o.__last=g.__key);else if(c!==null){const p=c.getWritable();if(g!==null){const v=g.getWritable();p.__prev=g.__key,v.__next=c.__key}else p.__prev=null}if(o.__size=f,u.length){const p=fe();if(ae(p)){const v=new Set(u),m=new Set(a),{anchor:h,focus:x}=p;Qd(h,v,m)&&pa(h,h.getNode(),this,d,c),Qd(x,v,m)&&pa(x,x.getNode(),this,d,c),f!==0||this.canBeEmpty()||cn(this)||this.remove()}}return o}getDOMSlot(e){return new zo(e)}exportDOM(e){const{element:t}=super.exportDOM(e);if(Ft(t)){const r=this.getIndent();r>0&&(t.style.paddingInlineStart=40*r+"px");const i=this.getDirection();i&&(t.dir=i)}return{element:t}}exportJSON(){const e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),r=this.getTextStyle();return t===0&&r===""||cn(this)||this.getChildren().some(pe)||(t!==0&&(e.textFormat=t),r!==""&&(e.textStyle=r)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,r){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){const r=this.getDOMSlot(e);let i=r.getFirstChild();for(let o=this.getFirstChild();o;o=o.getNextSibling()){const s=t.getElementByKey(o.getKey());s!==null&&(i==null?(r.insertChild(s),i=s):i!==s&&r.replaceChild(s,i),i=i.nextSibling)}}}function oe(n){return n instanceof bn}function Qd(n,e,t){let r=n.getNode();for(;r;){const i=r.__key;if(e.has(i)&&!t.has(i))return!0;r=r.getParent()}return!1}class xi extends $n{decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function rt(n){return n instanceof xi}class wi extends bn{__cachedText;static getType(){return"root"}static clone(){return new wi}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){le(51)}getTextContent(){const e=this.__cachedText;return!ds()&&ct()._dirtyType!==0||e===null?super.getTextContent():e}remove(){le(52)}replace(e){le(53)}insertBefore(e){le(54)}insertAfter(e){le(55)}updateDOM(e,t){return!1}splice(e,t,r){for(const i of r)oe(i)||rt(i)||le(282);return super.splice(e,t,r)}static importJSON(e){return Mt().updateFromJSON(e)}collapseAtStart(){return!0}}function Rt(n){return n instanceof wi}function Pv(n){return new fs(new Map(n._nodeMap))}function hc(){return new fs(new Map([["root",new wi]]))}function Dv(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&le(130,t.name),oe(n)){const r=e.children;Array.isArray(r)||le(59,t.name);const i=n.getChildren();for(let o=0;o<i.length;o++){const s=Dv(i[o]);r.push(s)}}return e}function Xw(n){return n instanceof fs}class fs{_nodeMap;_selection;_flushSync;_readOnly;constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return Yd(t&&t.editor||null,this,e)}clone(e){const t=new fs(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return Yd(null,this,()=>({root:Dv(Mt())}))}}class vc extends bn{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class Si extends bn{static getType(){return"paragraph"}static clone(e){return new Si(e.__key)}createDOM(e){const t=document.createElement("p"),r=Yi(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:Qw,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Ft(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r)}return{element:t}}static importJSON(e){return xt().updateFromJSON(e)}exportJSON(){const e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){const t=this.getChildren().find(pe);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){const r=xt();r.setTextFormat(e.format),r.setTextStyle(e.style);const i=this.getDirection();return r.setDirection(i),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,t),r}collapseAtStart(){const e=this.getChildren();if(e.length===0||pe(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function Qw(n){const e=xt();return n.style&&(e.setFormat(n.style.textAlign),Tc(n,e)),{node:e}}function xt(){return dn(new Si)}function pc(n){return n instanceof Si}const He=0,rn=1,Fv=4;function Iv(n,e,t,r){const i=n._keyToDOMMap;i.clear(),n._editorState=hc(),n._pendingEditorState=r,n._compositionKey=null,n._dirtyType=0,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),n._normalizedNodes=new Set,n._updateTags=new Set,n._updates=[],n._blockCursorElement=null;const o=n._observer;o!==null&&(o.disconnect(),n._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",i.set("root",t))}function $w(n){const e=new Set,t=new Set;let r=n;for(;r;){const{ownNodeConfig:i}=Va(r),o=r.transform;if(!t.has(o)){t.add(o);const s=r.transform();s&&e.add(s)}if(i){const s=i.$transform;s&&e.add(s),r=i.extends}else{const s=Object.getPrototypeOf(r);r=s.prototype instanceof $n&&s!==$n?s:void 0}}return e}function mc(n){const e=n||{},t=Yw(),r=e.theme||{},i=n===void 0?t:e.parentEditor||null,o=e.disableEvents||!1,s=hc(),a=e.namespace||(i!==null?i._config.namespace:Vv()),u=e.editorState,c=[wi,Mn,bi,_o,Si,vc,...e.nodes||[]],{onError:d,html:f}=e,g=e.editable===void 0||e.editable;let p;if(n===void 0&&t!==null)p=t._nodes;else{p=new Map;for(let m=0;m<c.length;m++){let h=c[m],x=null,_=null;if(typeof h!="function"){const b=h;h=b.replace,x=b.with,_=b.withKlass||null}Va(h);const S=h.getType(),k=$w(h);p.set(S,{exportDOM:f&&f.export?f.export.get(h):void 0,klass:h,replace:x,replaceWithKlass:_,sharedNodeState:Jh(c[m]),transforms:k})}}const v=new io(s,i,p,{disableEvents:o,namespace:a,theme:r},d||console.error,(function(m,h){const x=new Map,_=new Set,S=k=>{Object.keys(k).forEach(b=>{let C=x.get(b);C===void 0&&(C=[],x.set(b,C)),C.push(k[b])})};return m.forEach(k=>{const b=k.klass.importDOM;if(b==null||_.has(b))return;_.add(b);const C=b.call(k.klass);C!==null&&S(C)}),h&&S(h),x})(p,f?f.import:void 0),g,n);return u!==void 0&&(v._pendingEditorState=u,v._dirtyType=2),(function(m){m.registerCommand(Qh,Nw,He),m.registerCommand($h,Aw,He),m.registerCommand(ev,Ow,He),m.registerCommand(tv,Mw,He),m.registerCommand(nv,Pw,He)})(v),v}class io{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(e,t,r,i,o,s,a,u){this._createEditorArgs=u,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=i,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Vv(),this._onError=o,this._htmlConversions=s,this._editable=a,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,r){r===void 0&&le(35);const i=this._commands;i.has(e)||i.set(e,[new Set,new Set,new Set,new Set,new Set]);const o=i.get(e);o===void 0&&le(36,String(e));const s=o[r];return s.add(t),()=>{s.delete(t),o.every(a=>a.size===0)&&i.delete(e)}}registerMutationListener(e,t,r){const i=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,o=this._listeners.mutation;let s=o.get(t);s===void 0&&(s=new Set,o.set(t,s)),s.add(i);const a=r&&r.skipInitialization;return a!==void 0&&a||this.initializeMutationListener(t,i),()=>{s.delete(i),s.size===0&&o.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&le(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const r=this._editorState,i=af(r).get(t.getType());if(!i)return;const o=new Map;for(const s of i.keys())o.set(s,"created");o.size>0&&e(o,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const r=this.getRegisteredNode(e);return r.transforms.add(t),r}registerNodeTransform(e,t){const r=this.registerNodeTransformToKlass(e,t),i=[r],o=r.replaceWithKlass;if(o!=null){const s=this.registerNodeTransformToKlass(o,t);i.push(s)}return(function(s,a){const u=af(s.getEditorState()),c=[];for(const d of a){const f=u.get(d);f&&c.push(f)}c.length!==0&&s.update(()=>{for(const d of c)for(const f of d.keys()){const g=yt(f);g&&g.markDirty()}},s._pendingEditorState===null?{tag:ti}:void 0)})(this,i.map(s=>s.klass.getType())),()=>{i.forEach(s=>s.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return _e(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const r=Yi(this._config.theme,"root"),i=this._pendingEditorState||this._editorState;if(this._rootElement=e,Iv(this,t,e,i),t!==null&&(this._config.disableEvents||Dw(t),r!=null&&t.classList.remove(...r)),e!==null){const o=Ec(e),s=e.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=o,this._dirtyType=2,Vh(this),this._updateTags.add(ti),vr(this),this._config.disableEvents||(function(a,u){const c=a.ownerDocument;cu.set(a,c);const d=fa.get(c)??0;d<1&&c.addEventListener("selectionchange",xv),fa.set(c,d+1),a.__lexicalEditor=u;const f=yv(a);for(let g=0;g<uu.length;g++){const[p,v]=uu[g],m=typeof v=="function"?h=>{Pd(h)||(Md(h),(u.isEditable()||p==="click")&&v(h,u))}:h=>{if(Pd(h))return;Md(h);const x=u.isEditable();switch(p){case"cut":return x&&_e(u,lc,h);case"copy":return _e(u,za,h);case"paste":return x&&_e(u,Ia,h);case"dragstart":return x&&_e(u,ac,h);case"dragover":return x&&_e(u,gv,h);case"dragend":return x&&_e(u,ww,h);case"focus":return x&&_e(u,Cw,h);case"blur":return x&&_e(u,Ew,h);case"drop":return x&&_e(u,dv,h)}};a.addEventListener(p,m),f.push(()=>{a.removeEventListener(p,m)})}})(e,this),r!=null&&e.classList.add(...r)}else this._window=null,this._updateTags.add(ti),vr(this);Ro("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&le(38);let r=e;r._readOnly&&(r=Pv(e),r._selection=e._selection?e._selection.clone():null),Hh(this);const i=this._pendingEditorState,o=this._updateTags,s=t!==void 0?t.tag:null;i===null||i.isEmpty()||(s!=null&&o.add(s),vr(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,s!=null&&o.add(s),this._updating||vr(this)}parseEditorState(e,t){return(function(r,i,o){const s=hc(),a=Ut,u=un,c=jt,d=i._dirtyElements,f=i._dirtyLeaves,g=i._cloneNotNeeded,p=i._dirtyType;i._dirtyElements=new Map,i._dirtyLeaves=new Set,i._cloneNotNeeded=new Set,i._dirtyType=0,Ut=s,un=!1,jt=i,_c(null);try{const v=i._nodes;gc(r.root,v),o&&o(),s._readOnly=!0}catch(v){v instanceof Error&&i._onError(v)}finally{i._dirtyElements=d,i._dirtyLeaves=f,i._cloneNotNeeded=g,i._dirtyType=p,Ut=a,un=u,jt=c}return s})(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return vr(this),this.getEditorState().read(e,{editor:this})}update(e,t){(function(r,i,o){r._updating?r._updates.push([i,o]):ja(r,i,o)})(this,e,t)}focus(e,t={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),er(this,()=>{const i=fe(),o=Mt();i!==null?i.dirty||Qt(i.clone()):o.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?o.selectStart():o.selectEnd()),o2("focus"),s2(()=>{r.removeAttribute("autocapitalize"),e&&e()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=Kn(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Ro("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}io.version="0.40.0+prod.esm";let bu=null;function _c(n){bu=n}let e2=1;function Lv(n,e){const t=bc(n,e);return t===void 0&&le(30,e),t}function bc(n,e){return n._nodes.get(e)}const t2=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function Rv(n){return rt(so(n))}function yc(n){const e=document.activeElement;if(!Ft(e))return!1;const t=e.nodeName;return rt(so(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&Wa(e)==null)}function gs(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!yc(e)&&zv(e)===n}catch{return!1}}function xc(n){return n instanceof io}function zv(n){let e=n;for(;e!=null;){const t=Wa(e);if(xc(t))return t;e=hs(e)}return null}function Wa(n){return n?n.__lexicalEditor:null}function ni(n){return Ba(n)||n.isToken()}function hr(n){return ni(n)||n.isSegmented()}function kr(n){return xo(n)&&n.nodeType===3}function Bv(n){return xo(n)&&n.nodeType===9}function oo(n){let e=n;for(;e!=null;){if(kr(e))return e;e=e.firstChild}return null}function ma(n,e,t){const r=oi[e];if(t!==null&&(n&r)===(t&r))return n;let i=n^r;return e==="subscript"?i&=-65:e==="superscript"?i&=-33:e==="lowercase"?(i&=-513,i&=-1025):e==="uppercase"?(i&=-257,i&=-1025):e==="capitalize"&&(i&=-257,i&=-513),i}function Uv(n){return pe(n)||Gi(n)||rt(n)}function n2(n,e){const t=(function(){const s=bu;return bu=null,s})();if((e=e||t&&t.__key)!=null)return void(n.__key=e);Jt(),Av();const r=ct(),i=Wr(),o=""+e2++;i._nodeMap.set(o,n),oe(n)?r._dirtyElements.set(o,!0):r._dirtyLeaves.add(o),r._cloneNotNeeded.add(o),r._dirtyType=1,n.__key=o}function ri(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),i=n.getPreviousSibling(),o=n.getNextSibling(),s=o!==null?o.__key:null,a=i!==null?i.__key:null,u=i!==null?i.getWritable():null,c=o!==null?o.getWritable():null;i===null&&(r.__first=s),o===null&&(r.__last=a),u!==null&&(u.__next=s),c!==null&&(c.__prev=a),t.__prev=null,t.__next=null,t.__parent=null,r.__size--}}function _a(n){Av(),ha(n)&&le(323,n.__key,n.__type);const e=n.getLatest(),t=e.__parent,r=Wr(),i=ct(),o=r._nodeMap,s=i._dirtyElements;t!==null&&(function(u,c,d){let f=u;for(;f!==null;){if(d.has(f))return;const g=c.get(f);if(g===void 0)break;d.set(f,!1),f=g.__parent}})(t,o,s);const a=e.__key;i._dirtyType=1,oe(n)?s.set(a,!0):i._dirtyLeaves.add(a)}function qt(n){Jt();const e=ct(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){const r=yt(t);r!==null&&r.getWritable()}if(n!==null){const r=yt(n);r!==null&&r.getWritable()}}}function Nr(){return ds()?null:ct()._compositionKey}function yt(n,e){const t=(e||Wr())._nodeMap.get(n);return t===void 0?null:t}function jv(n,e){const t=Ka(n,ct());return t!==void 0?yt(t,e):null}function Ka(n,e){return n[`__lexicalKey_${e._key}`]}function so(n,e){let t=n;for(;t!=null;){const r=jv(t,e);if(r!==null)return r;t=hs(t)}return null}function Wv(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function $d(n){return n.read(()=>Mt().getTextContent())}function Mt(){return Kv(Wr())}function Kv(n){return n._nodeMap.get("root")}function Qt(n){Jt();const e=Wr();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function zi(n){const e=ct(),t=(function(r,i){let o=r;for(;o!=null;){const s=Ka(o,i);if(s!==void 0)return s;o=hs(o)}return null})(n,e);return t===null?n===e.getRootElement()?yt("root"):null:yt(t)}function Hv(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function wc(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function Vv(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function Jv(n){return kr(n)?n.nodeValue:null}function Sc(n,e,t){const r=Kn(Pn(e));if(r===null)return;const i=r.anchorNode;let{anchorOffset:o,focusOffset:s}=r;if(i!==null){let a=Jv(i);const u=so(i);if(a!==null&&pe(u)){if(a===Oa&&t){const c=t.length;a=t,o=c,s=c}a!==null&&kc(u,a,o,s,n)}}}function kc(n,e,t,r,i){let o=n;if(o.isAttached()&&(i||!o.isDirty())){const s=o.isComposing();let a=e;(s||i)&&e[e.length-1]===Oa&&(a=e.slice(0,-1));const u=o.getTextContent();if(i||a!==u){if(a===""){if(qt(null),us||mo||cs)o.remove();else{const m=ct();setTimeout(()=>{m.update(()=>{o.isAttached()&&o.remove()})},20)}return}const c=o.getParent(),d=yo(),f=o.getTextContentSize(),g=Nr(),p=o.getKey();if(o.isToken()||g!==null&&p===g&&!s||ae(d)&&(c!==null&&!c.canInsertTextBefore()&&d.anchor.offset===0||d.anchor.key===n.__key&&d.anchor.offset===0&&!o.canInsertTextBefore()&&!s||d.focus.key===n.__key&&d.focus.offset===f&&!o.canInsertTextAfter()&&!s))return void o.markDirty();const v=fe();if(!ae(v)||t===null||r===null)return void ef(o,a,v);if(v.setTextNodeRange(o,t,o,r),o.isSegmented()){const m=Bt(o.getTextContent());o.replace(m),o=m}ef(o,a,v)}}}function ef(n,e,t){if(n.setTextContent(e),ae(t)){const r=n.getKey();for(const i of["anchor","focus"]){const o=t[i];o.type==="text"&&o.key===r&&(o.offset=Fr(n,o.offset,"clamp"))}}}function Ps(n,e,t){const r=e[t]||!1;return r==="any"||r===n[t]}function r2(n,e){return Ps(n,e,"altKey")&&Ps(n,e,"ctrlKey")&&Ps(n,e,"shiftKey")&&Ps(n,e,"metaKey")}function st(n,e,t){return r2(n,t)&&n.key.toLowerCase()===e.toLowerCase()}const fr={ctrlKey:!Dn,metaKey:Dn},tf={altKey:Dn,ctrlKey:!Dn};function nf(n){return n.key==="Backspace"}function rf(n){return st(n,"a",fr)}function i2(n){const e=Mt();if(ae(n)){const t=n.anchor,r=n.focus,i=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(i.getKey(),0,"element"),r.set(i.getKey(),i.getChildrenSize(),"element"),ro(n),n}{const t=e.select(0,e.getChildrenSize());return Qt(ro(t)),t}}function Yi(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});const t=n.__lexicalClassNameCache,r=t[e];if(r!==void 0)return r;const i=n[e];if(typeof i=="string"){const o=Ur(i);return t[e]=o,o}return i}function Cc(n,e,t,r,i){if(t.size===0)return;const o=r.__type,s=r.__key,a=e.get(o);a===void 0&&le(33,o);const u=a.klass;let c=n.get(u);c===void 0&&(c=new Map,n.set(u,c));const d=c.get(s),f=d==="destroyed"&&i==="created";(d===void 0||f)&&c.set(s,f?"updated":i)}function of(n,e,t){const r=n.getParent();let i=t,o=n;return r!==null&&(e&&t===0?(i=o.getIndexWithinParent(),o=r):e||t!==o.getChildrenSize()||(i=o.getIndexWithinParent()+1,o=r)),o.getChildAtIndex(e?i-1:i)}function yu(n,e){const t=n.offset;if(n.type==="element")return of(n.getNode(),e,t);{const r=n.getNode();if(e&&t===0||!e&&t===r.getTextContentSize()){const i=e?r.getPreviousSibling():r.getNextSibling();return i===null?of(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):i}}return null}function qv(n){const e=Pn(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function _e(n,e,t){return(function(r,i,o){const s=wc(r);for(let a=4;a>=0;a--)for(let u=0;u<s.length;u++){const c=s[u],d=c._commands.get(i);if(d!==void 0){const f=d[a];if(f!==void 0){const g=Array.from(f),p=g.length;let v=!1;if(er(c,()=>{for(let m=0;m<p;m++)if(g[m](o,r))return void(v=!0)}),v)return v}}}return!1})(n,e,t)}function li(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&le(75,e),t}function hs(n){const e=n.assignedSlot||n.parentElement;return Su(e)?e.host:e}function Gv(n){return Bv(n)?n:Ft(n)?n.ownerDocument:null}function o2(n){Jt(),ct()._updateTags.add(n)}function s2(n){Jt(),ct()._deferred.push(n)}function xu(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function Ec(n){const e=Gv(n);return e?e.defaultView:null}function Pn(n){const e=n._window;return e===null&&le(78),e}function a2(n){let e=n.getParentOrThrow();for(;e!==null;){if(cn(e))return e;e=e.getParentOrThrow()}return e}function cn(n){return Rt(n)||oe(n)&&n.isShadowRoot()}function dn(n){const e=ct(),t=n.getType(),r=bc(e,t);r===void 0&&le(200,n.constructor.name,t);const{replace:i,replaceWithKlass:o}=r;if(i!==null){const s=i(n),a=s.constructor;return o!==null?s instanceof o||le(201,o.name,o.getType(),a.name,a.getType(),n.constructor.name,t):s instanceof n.constructor&&a!==n.constructor||le(202,a.name,a.getType(),n.constructor.name,t),s.__key===n.__key&&le(203,n.constructor.name,t,a.name,a.getType()),s}return n}function bl(n,e){!Rt(n.getParent())||oe(e)||rt(e)||le(99)}function l2(n){const e=yt(n);return e===null&&le(63,n),e}function yl(n){return(rt(n)||oe(n)&&!n.canBeEmpty())&&!n.isInline()}function wu(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function Kn(n){return Wn?(n||window).getSelection():null}function u2(n){const e=Ec(n);return e?e.getSelection():null}function Yv(n){return Ft(n)&&n.tagName==="A"}function Ft(n){return xo(n)&&n.nodeType===1}function xo(n){return typeof n=="object"&&n!==null&&"nodeType"in n&&typeof n.nodeType=="number"}function Su(n){return xo(n)&&n.nodeType===11}function ku(n){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return n.nodeName.match(e)!==null}function ba(n){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return n.nodeName.match(e)!==null}function xn(n){if(rt(n)&&!n.isInline())return!0;if(!oe(n)||cn(n))return!1;const e=n.getFirstChild(),t=e===null||Gi(e)||pe(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function Ha(){return ct()}const sf=new WeakMap,c2=new Map;function af(n){if(!n._readOnly&&n.isEmpty())return c2;n._readOnly||le(192);let e=sf.get(n);return e||(e=(function(t){const r=new Map;for(const[i,o]of t._nodeMap){const s=o.__type;let a=r.get(s);a||(a=new Map,r.set(s,a)),a.set(i,o)}return r})(n),sf.set(n,e)),e}function Zv(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function d2(n){return(e=Zv(n))[wv]=!0,e;var e}function Tc(n,e){const t=parseInt(n.style.paddingInlineStart,10)||0,r=Math.round(t/40);e.setIndent(r)}function f2(n){return n.__lexicalUnmanaged===!0}function Eo(n,e){return(function(t,r){return Object.prototype.hasOwnProperty.call(t,r)})(n,e)&&n[e]!==$n[e]}function Va(n){const e=md in n.prototype?n.prototype[md]():void 0,t=(function(s){if(!(s===$n||s.prototype instanceof $n)){let a="<unknown>",u="<unknown>";try{a=s.getType()}catch{}try{io.version&&(u=JSON.parse(io.version))}catch{}le(290,s.name,a,u)}return s===xi||s===bn||s===$n})(n),r=!t&&Eo(n,"getType")?n.getType():void 0;let i,o=r;if(e)if(r)i=e[r];else for(const[s,a]of Object.entries(e))o=s,i=a;if(!t&&o&&(Eo(n,"getType")||(n.getType=()=>o),Eo(n,"clone")||(n.clone=s=>(_c(s),new n)),Eo(n,"importJSON")||(n.importJSON=i&&i.$importJSON||(s=>new n().updateFromJSON(s))),!Eo(n,"importDOM")&&i)){const{importDOM:s}=i;s&&(n.importDOM=()=>s)}return{ownNodeConfig:i,ownNodeType:o}}function g2(n){const e=Ha();return Jt(),new(e.resolveRegisteredNodeAfterReplacements(e.getRegisteredNode(n))).klass}const on=(n,e)=>{let t=n;for(;t!=null&&!Rt(t);){if(e(t))return t;t=t.getParent()}return null},h2={next:"previous",previous:"next"};class Nc{origin;constructor(e){this.origin=e}[Symbol.iterator](){return Xv({hasNext:ao,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return Yt(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Yt(this.origin,this.direction)}remove(){const e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){const r=this.getNodeAtCaret();return e.is(this.origin)||e.is(r)||(r===null?this.insert(e):r.replace(e,t)),this}splice(e,t,r="next"){const i=r===this.direction?t:Array.from(t).reverse();let o=this;const s=this.getParentAtCaret(),a=new Map;for(let u=o.getAdjacentCaret();u!==null&&a.size<e;u=u.getAdjacentCaret()){const c=u.origin.getWritable();a.set(c.getKey(),c)}for(const u of i){if(a.size>0){const c=o.getNodeAtCaret();if(c){if(a.delete(c.getKey()),a.delete(u.getKey()),!(c.is(u)||o.origin.is(u))){const d=u.getParent();d&&d.is(s)&&u.remove(),c.replace(u)}}else c===null&&le(263,Array.from(a).join(" "))}else o.insert(u);o=Yt(u,this.direction)}for(const u of a.values())u.remove();return this}}class $o extends Nc{type="child";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:Un(e,this.direction)}getParentCaret(e="root"){return Yt(Ac(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=wo(this.direction);return Yt(this.getNodeAtCaret(),e)||Un(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof $o&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}const v2={root:Rt,shadowRoot:cn};function wo(n){return h2[n]}function Ac(n,e="root"){return v2[e](n)?null:n}class ui extends Nc{type="sibling";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:Yt(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return oe(this.origin)?Un(this.origin,this.direction):null}getParentCaret(e="root"){return Yt(Ac(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=wo(this.direction);return Yt(this.getNodeAtCaret(),e)||Un(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof ui&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof ui||e instanceof ci)&&this.direction===e.direction&&this.origin.is(e.origin)}}class ci extends Nc{type="text";offset;constructor(e,t){super(e),this.offset=t}getLatest(){const e=this.origin.getLatest();return e===this.origin?this:di(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return Yt(Ac(this.getParentAtCaret(),e),this.direction)}getFlipped(){return di(this.origin,wo(this.direction),this.offset)}isSamePointCaret(e){return e instanceof ci&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof ui||e instanceof ci)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return Yt(this.origin,this.direction)}}function Dr(n){return n instanceof ci}function ao(n){return n instanceof ui}function tr(n){return n instanceof $o}const p2={next:class extends ci{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(n){return this.origin.insertAfter(n),this}},previous:class extends ci{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(n){return this.origin.insertBefore(n),this}}},m2={next:class extends ui{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(n){return this.origin.insertAfter(n),this}},previous:class extends ui{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(n){return this.origin.insertBefore(n),this}}},_2={next:class extends $o{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(n){return this.origin.splice(0,0,[n]),this}},previous:class extends $o{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(n){return this.origin.splice(this.origin.getChildrenSize(),0,[n]),this}}};function Yt(n,e){return n?new m2[e](n):null}function di(n,e,t){return n?new p2[e](n,Fr(n,t)):null}function Fr(n,e,t="error"){const r=n.getTextContentSize();let i=e==="next"?r:e==="previous"?0:e;return(i<0||i>r)&&(t!=="clamp"&&Bh(284,String(e),String(r),n.getKey()),i=i<0?0:r),i}function lf(n,e){return new y2(n,e)}function Un(n,e){return oe(n)?new _2[e](n):null}function b2(n){return n&&n.getChildCaret()||n}function Oc(n){return n&&b2(n.getAdjacentCaret())}class Mc{type="node-caret-range";direction;anchor;focus;constructor(e,t,r){this.anchor=e,this.focus=t,this.direction=r}getLatest(){const e=this.anchor.getLatest(),t=this.focus.getLatest();return e===this.anchor&&t===this.focus?this:new Mc(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const e=i=>{const o=this[i].getLatest();return Dr(o)?(function(s,a){const{direction:u,origin:c}=s,d=Fr(c,a==="focus"?wo(u):u);return lf(s,d-s.offset)})(o,i):null},t=e("anchor"),r=e("focus");if(t&&r){const{caret:i}=t,{caret:o}=r;if(i.isSameNodeCaret(o))return[lf(i,o.offset-i.offset),null]}return[t,r]}iterNodeCarets(e="root"){const t=Dr(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),i=Dr(r),o=s=>s.isSameNodeCaret(r)?null:Oc(s)||s.getParentCaret(e);return Xv({hasNext:s=>s!==null&&!(i&&r.isSameNodeCaret(s)),initial:t.isSameNodeCaret(r)?null:o(t),map:s=>s,step:o})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class y2{type="slice";caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){const{distance:e,caret:{offset:t}}=this,r=t+e;return r<t?[r,t]:[t,r]}getTextContent(){const[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:e,direction:t}}=this,[r,i]=this.getSliceIndices(),o=e.getTextContent();return di(e.setTextContent(o.slice(0,r)+o.slice(i)),t,r)}}function Pc(n){return Br(n,Yt(Mt(),n.direction))}function x2(n){return Br(n,n)}function Br(n,e){return n.direction!==e.direction&&le(265),new Mc(n,e,n.direction)}function Xv(n){const{initial:e,hasNext:t,step:r,map:i}=n;let o=e;return{[Symbol.iterator](){return this},next(){if(!t(o))return{done:!0,value:void 0};const s={done:!1,value:i(o)};return o=r(o),s}}}function Qv(n,e){const t=Js(n.origin,e.origin);switch(t===null&&le(275,n.origin.getKey(),e.origin.getKey()),t.type){case"same":{const r=n.type==="text",i=e.type==="text";return r&&i?(function(o,s){return Math.sign(o-s)})(n.offset,e.offset):n.type===e.type?0:r?-1:i?1:n.type==="child"?-1:1}case"ancestor":return n.type==="child"?-1:1;case"descendant":return e.type==="child"?1:-1;case"branch":return $v(t)}}function $v(n){const{a:e,b:t}=n,r=e.__key,i=t.__key;let o=e,s=t;for(;o&&s;o=o.getNextSibling(),s=s.getNextSibling()){if(o.__key===i)return-1;if(s.__key===r)return 1}return o===null?1:-1}function Ds(n,e){return e.is(n)}function uf(n){return oe(n)?[n.getLatest(),null]:[n.getParent(),n.getLatest()]}function Js(n,e){if(n.is(e))return{commonAncestor:n,type:"same"};const t=new Map;for(let[r,i]=uf(n);r;i=r,r=r.getParent())t.set(r,i);for(let[r,i]=uf(e);r;i=r,r=r.getParent()){const o=t.get(r);if(o!==void 0)return o===null?(Ds(n,r)||le(276),{commonAncestor:r,type:"ancestor"}):i===null?(Ds(e,r)||le(277),{commonAncestor:r,type:"descendant"}):((oe(o)||Ds(n,o))&&(oe(i)||Ds(e,i))&&r.is(o.getParent())&&r.is(i.getParent())||le(278),{a:o,b:i,commonAncestor:r,type:"branch"})}return null}function Sr(n,e){const{type:t,key:r,offset:i}=n,o=l2(n.key);return t==="text"?(pe(o)||le(266,o.getType(),r),di(o,e,i)):(oe(o)||le(267,o.getType(),r),k2(o,n.offset,e))}function fi(n,e){const{origin:t,direction:r}=e,i=r==="next";Dr(e)?n.set(t.getKey(),e.offset,"text"):ao(e)?pe(t)?n.set(t.getKey(),Fr(t,r),"text"):n.set(t.getParentOrThrow().getKey(),t.getIndexWithinParent()+(i?1:0),"element"):(tr(e)&&oe(t)||le(268),n.set(t.getKey(),i?0:t.getChildrenSize(),"element"))}function w2(n){const e=fe(),t=ae(e)?e:cc();return qs(t,n),Qt(t),t}function qs(n,e){fi(n.anchor,e.anchor),fi(n.focus,e.focus)}function cf(n){const{anchor:e,focus:t}=n,r=Sr(e,"next"),i=Sr(t,"next"),o=Qv(r,i)<=0?"next":"previous";return Br(lo(r,o),lo(i,o))}function Dc(n){const{direction:e,origin:t}=n,r=Yt(t,wo(e)).getNodeAtCaret();return r?Yt(r,e):Un(t.getParentOrThrow(),e)}function df(n,e="root"){const t=[n];for(let r=tr(n)?n.getParentCaret(e):n.getSiblingCaret();r!==null;r=r.getParentCaret(e))t.push(Dc(r));return t}function xl(n){return!!n&&n.origin.isAttached()}function S2(n,e="removeEmptySlices"){if(n.isCollapsed())return n;const t="root",r="next";let i=e;const o=tp(n,r),s=df(o.anchor,t),a=df(o.focus.getFlipped(),t),u=new Set,c=[];for(const v of o.iterNodeCarets(t))if(tr(v))u.add(v.origin.getKey());else if(ao(v)){const{origin:m}=v;oe(m)&&!u.has(m.getKey())||c.push(m)}for(const v of c)v.remove();for(const v of o.getTextSlices()){if(!v)continue;const{origin:m}=v.caret,h=m.getTextContentSize(),x=Dc(Yt(m,r)),_=m.getMode();if(Math.abs(v.distance)===h&&i==="removeEmptySlices"||_==="token"&&v.distance!==0)x.remove();else if(v.distance!==0){i="removeEmptySlices";let S=v.removeTextSlice();const k=v.caret.origin;if(_==="segmented"){const b=S.origin,C=Bt(b.getTextContent()).setStyle(b.getStyle()).setFormat(b.getFormat());x.replaceOrInsert(C),S=di(C,r,S.offset)}k.is(s[0].origin)&&(s[0]=S),k.is(a[0].origin)&&(a[0]=S.getFlipped())}}let d,f;for(const v of s)if(xl(v)){d=Sn(v);break}for(const v of a)if(xl(v)){f=Sn(v);break}const g=(function(v,m,h){if(!v||!m)return null;const x=v.getParentAtCaret(),_=m.getParentAtCaret();if(!x||!_)return null;const S=x.getParents().reverse();S.push(x);const k=_.getParents().reverse();k.push(_);const b=Math.min(S.length,k.length);let C;for(C=0;C<b&&S[C]===k[C];C++);const T=(D,L)=>{let V;for(let J=C;J<D.length;J++){const R=D[J];if(cn(R))return;!V&&L(R)&&(V=R)}return V},O=T(S,xn),E=O&&T(k,D=>h.has(D.getKey())&&xn(D));return O&&E?[O,E]:null})(d,f,u);if(g){const[v,m]=g;Un(v,"previous").splice(0,m.getChildren()),m.remove()}const p=[d,f,...s,...a].find(xl);if(p)return x2(lo(Sn(p),n.direction));le(269,JSON.stringify(s.map(v=>v.origin.__key)))}function Sn(n){const e=(function(i){let o=i;for(;tr(o);){const s=Oc(o);if(!tr(s))break;o=s}return o})(n.getLatest()),{direction:t}=e;if(pe(e.origin))return Dr(e)?e:di(e.origin,t,t);const r=e.getAdjacentCaret();return ao(r)&&pe(r.origin)?di(r.origin,t,wo(t)):e}function ep(n){return Dr(n)&&n.offset!==Fr(n.origin,n.direction)}function lo(n,e){return n.direction===e?n:n.getFlipped()}function tp(n,e){return n.direction===e?n:Br(lo(n.focus,e),lo(n.anchor,e))}function k2(n,e,t){let r=Un(n,"next");for(let i=0;i<e;i++){const o=r.getAdjacentCaret();if(o===null)break;r=o}return lo(r,t)}function C2(...n){return n}function E2(n,e){if(!e||n===e)return n;for(const t in e)if(n[t]!==e[t])return{...n,...e};return n}function Ur(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}function ar(n,...e){const t=Ur(...e);t.length>0&&n.classList.add(...t)}function Fc(n,...e){const t=Ur(...e);t.length>0&&n.classList.remove(...t)}function lr(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}const Cu=new Map;function np(n){const e={};if(!n)return e;const t=n.split(";");for(const r of t)if(r!==""){const[i,o]=r.split(/:([^]+)/);i&&o&&(e[i.trim()]=o.trim())}return e}function ff(n){let e=Cu.get(n);return e===void 0&&(e=np(n),Cu.set(n,e)),e}function rp(n){const e=Ha().getElementByKey(n.getKey());if(e===null)return null;const t=e.ownerDocument.defaultView;return t===null?null:t.getComputedStyle(e)}function ip(n){return rp(Rt(n)?n:n.getParentOrThrow())}function gf(n){const e=ip(n);return e!==null&&e.direction==="rtl"}function op(n,e,t="self"){const r=n.getStartEndPoints();if(e.isSelected(n)&&!hr(e)&&r!==null){const[i,o]=r,s=n.isBackward(),a=i.getNode(),u=o.getNode(),c=e.is(a),d=e.is(u);if(c||d){const[f,g]=mu(n),p=a.is(u),v=e.is(s?u:a),m=e.is(s?a:u);let h,x=0;p?(x=f>g?g:f,h=f>g?f:g):v?(x=s?g:f,h=void 0):m&&(x=0,h=s?f:g);const _=e.__text.slice(x,h);_!==e.__text&&(t==="clone"&&(e=d2(e)),e.__text=_)}}return e}function T2(n){const e=n.getStyle(),t=np(e);Cu.set(e,t)}function N2(n,e){const t=n.getFormatType(),r=n.getIndent();t!==e.getFormatType()&&e.setFormat(t),r!==e.getIndent()&&e.setIndent(r)}function Ja(n,e,t=N2){if(n===null)return;const r=n.getStartEndPoints(),i=new Map;let o=null;if(r){const[s,a]=r;o=cc(),o.anchor.set(s.key,s.offset,s.type),o.focus.set(a.key,a.offset,a.type);const u=on(s.getNode(),xn),c=on(a.getNode(),xn);oe(u)&&i.set(u.getKey(),u),oe(c)&&i.set(c.getKey(),c)}for(const s of n.getNodes())if(oe(s)&&xn(s))i.set(s.getKey(),s);else if(r===null){const a=on(s,xn);oe(a)&&i.set(a.getKey(),a)}for(const[s,a]of i){const u=e();t(a,u),a.replace(u,!0),o&&(s===o.anchor.key&&o.anchor.set(u.getKey(),o.anchor.offset,o.anchor.type),s===o.focus.key&&o.focus.set(u.getKey(),o.focus.offset,o.focus.type))}o&&n.is(fe())&&Qt(o)}function sp(n){const e=ap(n);return e!==null&&e.writingMode==="vertical-rl"}function ap(n){const e=n.anchor.getNode();return oe(e)?rp(e):ip(e)}function hf(n,e){let t=sp(n)?!e:e;lp(n)&&(t=!t);const r=Sr(n.focus,t?"previous":"next");if(ep(r))return!1;for(const i of Pc(r)){if(tr(i))return!i.origin.isInline();if(!oe(i.origin)){if(rt(i.origin))return!0;break}}return!1}function A2(n,e,t,r){n.modify(e?"extend":"move",t,r)}function lp(n){const e=ap(n);return e!==null&&e.direction==="rtl"}function vf(n,e,t){const r=lp(n);let i;i=sp(n)||r?!t:t,A2(n,e,i,"character")}function O2(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const qa=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,M2=qa&&"documentMode"in document?document.documentMode:null,P2=qa&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);!(!qa||!("InputEvent"in window)||M2)&&"getTargetRanges"in new window.InputEvent("input");const up=qa,D2=P2;function F2(n){return n?n.getAdjacentCaret():null}function cp(n,e){let t=n;for(;t!=null;){if(t instanceof e)return t;t=t.getParent()}return null}function dp(n){const e=on(n,t=>oe(t)&&!t.isInline());return oe(e)||O2(4,n.__key),e}function Ar(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}let wl=!(D2||!up)&&void 0;function pf(n,e=!1){let t=1;if((function(){if(wl===void 0){const r=document.createElement("div");r.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(r);const i=r.getBoundingClientRect();r.style.setProperty("zoom","2"),wl=r.getBoundingClientRect().width===i.width,document.body.removeChild(r)}return wl})()||e)for(;n;)t*=Number(window.getComputedStyle(n).getPropertyValue("zoom")),n=n.parentElement;return t}function I2(n,e){const t=Bv(e)?e.body.childNodes:e.childNodes;let r=[];const i=[];for(const o of t)if(!gp.has(o.nodeName)){const s=hp(o,n,i,!1);s!==null&&(r=r.concat(s))}return(function(o){for(const s of o)s.getNextSibling()instanceof vc&&s.insertAfter(wr());for(const s of o){const a=s.getChildren();for(const u of a)s.insertBefore(u);s.remove()}})(i),r}function L2(n,e){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const t=document.createElement("div"),r=Mt().getChildren();for(let i=0;i<r.length;i++)fp(n,r[i],t,e);return t.innerHTML}function fp(n,e,t,r=null){let i=r===null||e.isSelected(r);const o=oe(e)&&e.excludeFromCopy("html");let s=e;r!==null&&pe(e)&&(s=op(r,e,"clone"));const a=oe(s)?s.getChildren():[],u=bc(n,s.getType());let c;c=u&&u.exportDOM!==void 0?u.exportDOM(n,s):s.exportDOM(n);const{element:d,after:f}=c;if(!d)return!1;const g=document.createDocumentFragment();for(let p=0;p<a.length;p++){const v=a[p],m=fp(n,v,g,r);!i&&oe(e)&&m&&e.extractWithChild(v,r,"html")&&(i=!0)}if(i&&!o){if((Ft(d)||Su(d))&&d.append(g),t.append(d),f){const p=f.call(s,d);p&&(Su(d)?d.replaceChildren(p):d.replaceWith(p))}}else t.append(g);return i}const gp=new Set(["STYLE","SCRIPT"]);function hp(n,e,t,r,i=new Map,o){let s=[];if(gp.has(n.nodeName))return s;let a=null;const u=(function(v,m){const{nodeName:h}=v,x=m._htmlConversions.get(h.toLowerCase());let _=null;if(x!==void 0)for(const S of x){const k=S(v);k!==null&&(_===null||(_.priority||0)<=(k.priority||0))&&(_=k)}return _!==null?_.conversion:null})(n,e),c=u?u(n):null;let d=null;if(c!==null){d=c.after;const v=c.node;if(a=Array.isArray(v)?v[v.length-1]:v,a!==null){for(const[,m]of i)if(a=m(a,o),!a)break;a&&s.push(...Array.isArray(v)?v:[a])}c.forChild!=null&&i.set(n.nodeName,c.forChild)}const f=n.childNodes;let g=[];const p=(a==null||!cn(a))&&(a!=null&&_u(a)||r);for(let v=0;v<f.length;v++)g.push(...hp(f[v],e,t,p,new Map(i),a));return d!=null&&(g=d(g)),ba(n)&&(g=R2(n,g,p?()=>{const v=new vc;return t.push(v),v}:xt)),a==null?g.length>0?s=s.concat(g):ba(n)&&(function(v){return v.nextSibling==null||v.previousSibling==null?!1:ku(v.nextSibling)&&ku(v.previousSibling)})(n)&&(s=s.concat(wr())):oe(a)&&a.append(...g),s}function R2(n,e,t){const r=n.style.textAlign,i=[];let o=[];for(let s=0;s<e.length;s++){const a=e[s];if(_u(a))r&&!a.getFormat()&&a.setFormat(r),i.push(a);else if(o.push(a),s===e.length-1||s<e.length-1&&_u(e[s+1])){const u=t();u.setFormat(r),u.append(...o),i.push(u),o=[]}}return i}function ya(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function z2(n,e=fe()){return e==null&&ya(166),ae(e)&&e.isCollapsed()||e.getNodes().length===0?"":L2(n,e)}function B2(n,e=fe()){return e==null&&ya(166),ae(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(U2(n,e))}function mf(n,e,t){const r=n.getData("application/x-lexical-editor");if(r)try{const a=JSON.parse(r);if(a.namespace===t._config.namespace&&Array.isArray(a.nodes))return _f(t,j2(a.nodes),e)}catch(a){console.error(a)}const i=n.getData("text/html"),o=n.getData("text/plain");if(i&&o!==i)try{const a=new DOMParser().parseFromString((function(u){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:c=>c}).createHTML(u):u})(i),"text/html");return _f(t,I2(t,a),e)}catch(a){console.error(a)}const s=o||n.getData("text/uri-list");if(s!=null)if(ae(e)){const a=s.split(/(\r?\n|\t)/);a[a.length-1]===""&&a.pop();for(let u=0;u<a.length;u++){const c=fe();if(ae(c)){const d=a[u];d===`
|
|
25
|
-
`||d===`\r
|
|
26
|
-
`?c.insertParagraph():d===" "?c.insertNodes([bo()]):c.insertText(d)}}}else e.insertRawText(s)}function _f(n,e,t){n.dispatchCommand(mw,{nodes:e,selection:t})||(t.insertNodes(e),(function(r){if(ae(r)&&r.isCollapsed()){const i=r.anchor;let o=null;const s=Sr(i,"previous");if(s)if(Dr(s))o=s.origin;else{const a=Br(s,Un(Mt(),"next").getFlipped());for(const u of a){if(pe(u.origin)){o=u.origin;break}if(oe(u.origin)&&!u.origin.isInline())break}}if(o&&pe(o)){const a=o.getFormat(),u=o.getStyle();r.format===a&&r.style===u||(r.format=a,r.style=u,r.dirty=!0)}}})(t))}function vp(n,e,t,r=[]){let i=e===null||t.isSelected(e);const o=oe(t)&&t.excludeFromCopy("html");let s=t;e!==null&&pe(s)&&(s=op(e,s,"clone"));const a=oe(s)?s.getChildren():[],u=(function(c){const d=c.exportJSON(),f=c.constructor;if(d.type!==f.getType()&&ya(58,f.name),oe(c)){const g=d.children;Array.isArray(g)||ya(59,f.name)}return d})(s);pe(s)&&s.getTextContentSize()===0&&(i=!1);for(let c=0;c<a.length;c++){const d=a[c],f=vp(n,e,d,u.children);!i&&oe(t)&&f&&t.extractWithChild(d,e,"clone")&&(i=!0)}if(i&&!o)r.push(u);else if(Array.isArray(u.children))for(let c=0;c<u.children.length;c++){const d=u.children[c];r.push(d)}return i}function U2(n,e){const t=[],r=Mt().getChildren();for(let i=0;i<r.length;i++)vp(n,e,r[i],t);return{namespace:n._config.namespace,nodes:t}}function j2(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=Zw(r);pe(i)&&T2(i),e.push(i)}return e}let Ni=null;async function bf(n,e,t){if(Ni!==null)return!1;if(e!==null)return new Promise((c,d)=>{n.update(()=>{c(yf(n,e,t))})});const r=n.getRootElement(),i=n._window||window,o=i.document,s=Kn(i);if(r===null||s===null)return!1;const a=o.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(o.createTextNode("#")),r.append(a);const u=new Range;return u.setStart(a,0),u.setEnd(a,1),s.removeAllRanges(),s.addRange(u),new Promise((c,d)=>{const f=n.registerCommand(za,g=>(Ar(g,ClipboardEvent)&&(f(),Ni!==null&&(i.clearTimeout(Ni),Ni=null),c(yf(n,g,t))),!0),Fv);Ni=i.setTimeout(()=>{f(),Ni=null,c(!1)},50),o.execCommand("copy"),a.remove()})}function yf(n,e,t){if(t===void 0){const i=Kn(n._window),o=fe();if(!o||o.isCollapsed()||!i)return!1;const s=i.anchorNode,a=i.focusNode;if(s!==null&&a!==null&&!gs(n,s,a))return!1;t=W2(o)}e.preventDefault();const r=e.clipboardData;return r!==null&&(K2(r,t),!0)}const pp=[["text/html",z2],["application/x-lexical-editor",B2]];function W2(n=fe()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=Ha();for(const[r,i]of pp){const o=i(t,n);o!==null&&(e[r]=o)}}return e}function K2(n,e){for(const[t]of pp)e[t]===void 0&&n.setData(t,"");for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}const H2=Symbol.for("preact-signals");function Ga(){if(Ir>1)return void Ir--;let n,e=!1;for(;Bo!==void 0;){let t=Bo;for(Bo=void 0,Eu++;t!==void 0;){const r=t.o;if(t.o=void 0,t.f&=-3,!(8&t.f)&&mp(t))try{t.c()}catch(i){e||(n=i,e=!0)}t=r}}if(Eu=0,Ir--,e)throw n}function V2(n){if(Ir>0)return n();Ir++;try{return n()}finally{Ga()}}let it,Bo;function xf(n){const e=it;it=void 0;try{return n()}finally{it=e}}let Ir=0,Eu=0,Gs=0;function wf(n){if(it===void 0)return;let e=n.n;return e===void 0||e.t!==it?(e={i:0,S:n,p:it.s,n:void 0,t:it,e:void 0,x:void 0,r:e},it.s!==void 0&&(it.s.n=e),it.s=e,n.n=e,32&it.f&&n.S(e),e):e.i===-1?(e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=it.s,e.n=void 0,it.s.n=e,it.s=e),e):void 0}function nn(n,e){this.v=n,this.i=0,this.n=void 0,this.t=void 0,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function J2(n,e){return new nn(n,e)}function mp(n){for(let e=n.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function Sf(n){for(let e=n.s;e!==void 0;e=e.n){const t=e.S.n;if(t!==void 0&&(e.r=t),e.S.n=e,e.i=-1,e.n===void 0){n.s=e;break}}}function _p(n){let e,t=n.s;for(;t!==void 0;){const r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):e=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}n.s=e}function Ai(n,e){nn.call(this,void 0),this.x=n,this.s=void 0,this.g=Gs-1,this.f=4,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function bp(n){const e=n.u;if(n.u=void 0,typeof e=="function"){Ir++;const t=it;it=void 0;try{e()}catch(r){throw n.f&=-2,n.f|=8,Ic(n),r}finally{it=t,Ga()}}}function Ic(n){for(let e=n.s;e!==void 0;e=e.n)e.S.U(e);n.x=void 0,n.s=void 0,bp(n)}function q2(n){if(it!==this)throw new Error("Out-of-order effect");_p(this),it=n,this.f&=-2,8&this.f&&Ic(this),Ga()}function Li(n,e){this.x=n,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=e?.name}function Lc(n,e){const t=new Li(n,e);try{t.c()}catch(i){throw t.d(),i}const r=t.d.bind(t);return r[Symbol.dispose]=r,r}function G2(n,e={}){const t={};for(const r in n){const i=e[r],o=J2(i===void 0?n[r]:i);t[r]=o}return t}nn.prototype.brand=H2,nn.prototype.h=function(){return!0},nn.prototype.S=function(n){const e=this.t;e!==n&&n.e===void 0&&(n.x=e,this.t=n,e!==void 0?e.e=n:xf(()=>{var t;(t=this.W)==null||t.call(this)}))},nn.prototype.U=function(n){if(this.t!==void 0){const e=n.e,t=n.x;e!==void 0&&(e.x=t,n.e=void 0),t!==void 0&&(t.e=e,n.x=void 0),n===this.t&&(this.t=t,t===void 0&&xf(()=>{var r;(r=this.Z)==null||r.call(this)}))}},nn.prototype.subscribe=function(n){return Lc(()=>{const e=this.value,t=it;it=void 0;try{n(e)}finally{it=t}},{name:"sub"})},nn.prototype.valueOf=function(){return this.value},nn.prototype.toString=function(){return this.value+""},nn.prototype.toJSON=function(){return this.value},nn.prototype.peek=function(){const n=it;it=void 0;try{return this.value}finally{it=n}},Object.defineProperty(nn.prototype,"value",{get(){const n=wf(this);return n!==void 0&&(n.i=this.i),this.v},set(n){if(n!==this.v){if(Eu>100)throw new Error("Cycle detected");this.v=n,this.i++,Gs++,Ir++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{Ga()}}}}),Ai.prototype=new nn,Ai.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Gs))return!0;if(this.g=Gs,this.f|=1,this.i>0&&!mp(this))return this.f&=-2,!0;const n=it;try{Sf(this),it=this;const e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return it=n,_p(this),this.f&=-2,!0},Ai.prototype.S=function(n){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}nn.prototype.S.call(this,n)},Ai.prototype.U=function(n){if(this.t!==void 0&&(nn.prototype.U.call(this,n),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},Ai.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let n=this.t;n!==void 0;n=n.x)n.t.N()}},Object.defineProperty(Ai.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const n=wf(this);if(this.h(),n!==void 0&&(n.i=this.i),16&this.f)throw this.v;return this.v}}),Li.prototype.c=function(){const n=this.S();try{if(8&this.f||this.x===void 0)return;const e=this.x();typeof e=="function"&&(this.u=e)}finally{n()}},Li.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,bp(this),Sf(this),Ir++;const n=it;return it=this,q2.bind(this,n)},Li.prototype.N=function(){2&this.f||(this.f|=2,this.o=Bo,Bo=this)},Li.prototype.d=function(){this.f|=8,1&this.f||Ic(this)},Li.prototype.dispose=function(){this.d()};function Y2(n){return(typeof n.nodes=="function"?n.nodes():n.nodes)||[]}function ft(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function yp(n,e){if(n&&e&&!Array.isArray(e)&&typeof n=="object"&&typeof e=="object"){const t=n,r=e;for(const i in r)t[i]=yp(t[i],r[i]);return n}return e}const Rc=0,Tu=1,xp=2,Sl=3,Fs=4,Oi=5,kl=6,To=7;function Cl(n){return n.id===Rc}function wp(n){return n.id===xp}function Z2(n){return(function(e){return e.id===Tu})(n)||ft(305,String(n.id),String(Tu)),Object.assign(n,{id:xp})}const X2=new Set;let Q2=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:Rc}}mergeConfigs(){let e=this.extension.config||{};const t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):E2;for(const r of this.configs)e=t(e,r);return e}init(e){const t=this.state;wp(t)||ft(306,String(t.id));const r={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},i={...r,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},o=(function(a,u,c){return Object.assign(a,{config:u,id:Sl,registerState:c})})(t,this.mergeConfigs(),r);let s;this.state=o,this.extension.init&&(s=this.extension.init(e,o.config,r)),this.state=(function(a,u,c){return Object.assign(a,{id:Fs,initResult:u,registerState:c})})(o,s,i)}build(e){const t=this.state;let r;t.id!==Fs&&ft(307,String(t.id),String(Oi)),this.extension.build&&(r=this.extension.build(e,t.config,t.registerState));const i={...t.registerState,getOutput:()=>r,getSignal:this.getSignal.bind(this)};this.state=(function(o,s,a){return Object.assign(o,{id:Oi,output:s,registerState:a})})(t,r,i)}register(e,t){this._signal=t;const r=this.state;r.id!==Oi&&ft(308,String(r.id),String(Oi));const i=this.extension.register&&this.extension.register(e,r.config,r.registerState);return this.state=(function(o){return Object.assign(o,{id:kl})})(r),()=>{const o=this.state;o.id!==To&&ft(309,String(r.id),String(To)),this.state=(function(s){return Object.assign(s,{id:Oi})})(o),i&&i()}}afterRegistration(e){const t=this.state;let r;return t.id!==kl&&ft(310,String(t.id),String(kl)),this.extension.afterRegistration&&(r=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=(function(i){return Object.assign(i,{id:To})})(t),r}getSignal(){return this._signal===void 0&&ft(311),this._signal}getInitResult(){this.extension.init===void 0&&ft(312,this.extension.name);const e=this.state;return(function(t){return t.id>=Fs})(e)||ft(313,String(e.id),String(Fs)),e.initResult}getInitPeer(e){const t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){const e=this.state;return(function(t){return t.id>=Sl})(e)||ft(314,String(e.id),String(Sl)),{config:e.config}}getPeer(e){const t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){const t=this.builder.getExtensionRep(e);return t===void 0&&ft(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){const t=this.builder.getExtensionRep(e);return t===void 0&&ft(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){const e=this.state;return(function(t){return t.id>=To})(e)||ft(316,String(e.id),String(To)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||X2}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([t])=>t)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){const e=this.state;(function(t){return t.id>=Oi})(e)||ft(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}};const kf={tag:ti};function $2(){const n=Mt();n.isEmpty()&&n.append(xt())}const eS={config:{setOptions:kf,updateOptions:kf},init:({$initialEditorState:n=$2})=>({$initialEditorState:n,initialized:!1}),afterRegistration(n,{updateOptions:e,setOptions:t},r){const i=r.getInitResult();if(!i.initialized){i.initialized=!0;const{$initialEditorState:o}=i;if(Xw(o))n.setEditorState(o,t);else if(typeof o=="function")n.update(()=>{o(n)},e);else if(o&&(typeof o=="string"||typeof o=="object")){const s=n.parseEditorState(o);n.setEditorState(s,t)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[wi,Mn,bi,_o,Si]},Cf=Symbol.for("@lexical/extension/LexicalBuilder");function Ef(){}function tS(n){throw n}function Is(n){return Array.isArray(n)?n:[n]}const El="0.40.0+prod.esm";let nS=class Ys{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=El,this.roots=e;for(const t of e)this.addExtension(t)}static fromExtensions(e){const t=[Is(eS)];for(const r of e)t.push(Is(r));return new Ys(t)}static maybeFromEditor(e){const t=e[Cf];return t&&(t.PACKAGE_VERSION!==El&&ft(292,t.PACKAGE_VERSION,El),t instanceof Ys||ft(293)),t}static fromEditor(e){const t=Ys.maybeFromEditor(e);return t===void 0&&ft(294),t}constructEditor(){const{$initialEditorState:e,onError:t,...r}=this.buildCreateEditorArgs(),i=Object.assign(mc({...r,...t?{onError:o=>{t(o,i)}}:{}}),{[Cf]:this});for(const o of this.sortedExtensionReps())o.build(i);return i}buildEditor(){let e=Ef;function t(){try{e()}finally{e=Ef}}const r=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=lr(this.registerEditor(r),()=>r.setRootElement(null)),r}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){const t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&ft(295,e.name),t}addEdge(e,t,r){const i=this.outgoingConfigEdges.get(e);i?i.set(t,r):this.outgoingConfigEdges.set(e,new Map([[t,r]]));const o=this.incomingEdges.get(t);o?o.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&ft(296);const t=Is(e),[r]=t;typeof r.name!="string"&&ft(297,typeof r.name);let i=this.extensionNameMap.get(r.name);if(i!==void 0&&i.extension!==r&&ft(298,r.name),!i){i=new Q2(this,r),this.extensionNameMap.set(r.name,i);const o=this.conflicts.get(r.name);typeof o=="string"&&ft(299,r.name,o);for(const s of r.conflictsWith||[])this.extensionNameMap.has(s)&&ft(299,r.name,s),this.conflicts.set(s,r.name);for(const s of r.dependencies||[]){const a=Is(s);this.addEdge(r.name,a[0].name,a.slice(1)),this.addExtension(a)}for(const[s,a]of r.peerDependencies||[])this.addEdge(r.name,s,a?[a]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const e=[],t=(r,i)=>{let o=r.state;if(wp(o))return;const s=r.extension.name;var a;Cl(o)||ft(300,s,i||"[unknown]"),Cl(a=o)||ft(304,String(a.id),String(Rc)),o=Object.assign(a,{id:Tu}),r.state=o;const u=this.outgoingConfigEdges.get(s);if(u)for(const c of u.keys()){const d=this.extensionNameMap.get(c);d&&t(d,s)}o=Z2(o),r.state=o,e.push(r)};for(const r of this.extensionNameMap.values())Cl(r.state)&&t(r);for(const r of e)for(const[i,o]of this.outgoingConfigEdges.get(r.extension.name)||[])if(o.length>0){const s=this.extensionNameMap.get(i);if(s)for(const a of o)s.configs.add(a)}for(const[r,...i]of this.roots)if(i.length>0){const o=this.extensionNameMap.get(r.name);o===void 0&&ft(301,r.name);for(const s of i)o.configs.add(s)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){const t=this.sortedExtensionReps(),r=new AbortController,i=[()=>r.abort()],o=r.signal;for(const s of t){const a=s.register(e,o);a&&i.push(a)}for(const s of t){const a=s.afterRegistration(e);a&&i.push(a)}return lr(...i)}buildCreateEditorArgs(){const e={},t=new Set,r=new Map,i=new Map,o={},s={},a=this.sortedExtensionReps();for(const d of a){const{extension:f}=d;if(f.onError!==void 0&&(e.onError=f.onError),f.disableEvents!==void 0&&(e.disableEvents=f.disableEvents),f.parentEditor!==void 0&&(e.parentEditor=f.parentEditor),f.editable!==void 0&&(e.editable=f.editable),f.namespace!==void 0&&(e.namespace=f.namespace),f.$initialEditorState!==void 0&&(e.$initialEditorState=f.$initialEditorState),f.nodes)for(const g of Y2(f)){if(typeof g!="function"){const p=r.get(g.replace);p&&ft(302,f.name,g.replace.name,p.extension.name),r.set(g.replace,d)}t.add(g)}if(f.html){if(f.html.export)for(const[g,p]of f.html.export.entries())i.set(g,p);f.html.import&&Object.assign(o,f.html.import)}f.theme&&yp(s,f.theme)}Object.keys(s).length>0&&(e.theme=s),t.size&&(e.nodes=[...t]);const u=Object.keys(o).length>0,c=i.size>0;(u||c)&&(e.html={},u&&(e.html.import=o),c&&(e.html.export=i));for(const d of a)d.init(e);return e.onError||(e.onError=tS),e}};function rS(n,e){const t=nS.fromEditor(n).extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}function fn(){return eo("editor")}function iS(n){pi("editor",n)}function oS(){return eo("isEditable")}function sS(n){pi("historyState",n)}function aS(){pi("editorSharedContext",{})}function lS(){return eo("editorSharedContext")}function uS(){return lS().ImageHistoryComponentType}function Tf(n,e){if(document.caretRangeFromPoint!==void 0){const t=document.caretRangeFromPoint(n,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const t=document.caretPositionFromPoint(n,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}return null}const ki=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,cS=ki&&"documentMode"in document?document.documentMode:null,dS=ki&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),fS=!(!ki||!("InputEvent"in window)||cS)&&"getTargetRanges"in new window.InputEvent("input"),gS=ki&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Nf=ki&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,hS=ki&&/^(?=.*Chrome).*/i.test(navigator.userAgent),vS=ki&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&dS&&!hS,Af=Ae("DRAG_DROP_PASTE_FILE");class Ya extends bn{static getType(){return"quote"}static clone(e){return new Ya(e.__key)}createDOM(e){const t=document.createElement("blockquote");return ar(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:pS,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Ft(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r);const i=this.getDirection();i&&(t.dir=i)}return{element:t}}static importJSON(e){return zc().updateFromJSON(e)}insertNewAfter(e,t){const r=xt(),i=this.getDirection();return r.setDirection(i),this.insertAfter(r,t),r}collapseAtStart(){const e=xt();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function zc(){return dn(new Ya)}class vs extends bn{__tag;static getType(){return"heading"}static clone(e){return new vs(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}setTag(e){const t=this.getWritable();return this.__tag=e,t}createDOM(e){const t=this.__tag,r=document.createElement(t),i=e.theme.heading;if(i!==void 0){const o=i[t];ar(r,o)}return r}updateDOM(e,t,r){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:Mi,priority:0}),h2:e=>({conversion:Mi,priority:0}),h3:e=>({conversion:Mi,priority:0}),h4:e=>({conversion:Mi,priority:0}),h5:e=>({conversion:Mi,priority:0}),h6:e=>({conversion:Mi,priority:0}),p:e=>{const t=e.firstChild;return t!==null&&Of(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>Of(e)?{conversion:t=>({node:Bi("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Ft(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r);const i=this.getDirection();i&&(t.dir=i)}return{element:t}}static importJSON(e){return Bi(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){const r=e?e.anchor.offset:0,i=this.getLastDescendant(),o=!i||e&&e.anchor.key===i.getKey()&&r===i.getTextContentSize()||!e?xt():Bi(this.getTag()),s=this.getDirection();if(o.setDirection(s),this.insertAfter(o,t),r===0&&!this.isEmpty()&&e){const a=xt();a.select(),this.replace(a,!0)}return o}collapseAtStart(){const e=this.isEmpty()?xt():Bi(this.getTag());return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}extractWithChild(){return!0}}function Of(n){return n.nodeName.toLowerCase()==="span"&&n.style.fontSize==="26pt"}function Mi(n){const e=n.nodeName.toLowerCase();let t=null;return e!=="h1"&&e!=="h2"&&e!=="h3"&&e!=="h4"&&e!=="h5"&&e!=="h6"||(t=Bi(e),n.style!==null&&(Tc(n,t),t.setFormat(n.style.textAlign))),{node:t}}function pS(n){const e=zc();return n.style!==null&&(e.setFormat(n.style.textAlign),Tc(n,e)),{node:e}}function Bi(n="h1"){return dn(new vs(n))}function mS(n){return n instanceof vs}function Ls(n){let e=null;if(Ar(n,DragEvent)?e=n.dataTransfer:Ar(n,ClipboardEvent)&&(e=n.clipboardData),e===null)return[!1,[],!1];const t=e.types,r=t.includes("Files"),i=t.includes("text/html")||t.includes("text/plain");return[r,Array.from(e.files),i]}function Mf(n){const e=fe();if(!ae(e))return!1;const t=new Set,r=e.getNodes();for(let i=0;i<r.length;i++){const o=r[i],s=o.getKey();if(t.has(s))continue;const a=on(o,c=>oe(c)&&!c.isInline());if(a===null)continue;const u=a.getKey();a.canIndent()&&!t.has(u)&&(t.add(u),n(a))}return t.size>0}function Pf(n){const e=so(n);return rt(e)}function Tl(n){for(const e of["lowercase","uppercase","capitalize"])n.hasFormat(e)&&n.toggleFormat(e)}function _S(n){return lr(n.registerCommand(Fa,e=>{const t=fe();return!!kt(t)&&(t.clear(),!0)},He),n.registerCommand(ei,e=>{const t=fe();return ae(t)?(t.deleteCharacter(e),!0):!!kt(t)&&(t.deleteNodes(),!0)},He),n.registerCommand(Yo,e=>{const t=fe();return!!ae(t)&&(t.deleteWord(e),!0)},He),n.registerCommand(Zo,e=>{const t=fe();return!!ae(t)&&(t.deleteLine(e),!0)},He),n.registerCommand(Ji,e=>{const t=fe();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const r=e.dataTransfer;if(r!=null)mf(r,t,n);else if(ae(t)){const i=e.data;return i&&t.insertText(i),!0}}return!0},He),n.registerCommand(au,()=>{const e=fe();return!!ae(e)&&(e.removeText(),!0)},He),n.registerCommand(wn,e=>{const t=fe();return!!ae(t)&&(t.formatText(e),!0)},He),n.registerCommand(fv,e=>{const t=fe();if(!ae(t)&&!kt(t))return!1;const r=t.getNodes();for(const i of r){const o=on(i,s=>oe(s)&&!s.isInline());o!==null&&o.setFormat(e)}return!0},He),n.registerCommand(Vi,e=>{const t=fe();return!!ae(t)&&(t.insertLineBreak(e),!0)},He),n.registerCommand(Go,()=>{const e=fe();return!!ae(e)&&(e.insertParagraph(),!0)},He),n.registerCommand(yw,()=>(Ii([bo()]),!0),He),n.registerCommand(xw,()=>Mf(e=>{const t=e.getIndent();e.setIndent(t+1)}),He),n.registerCommand(Nd,()=>Mf(e=>{const t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),He),n.registerCommand(ov,e=>{const t=fe();if(kt(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}else if(ae(t)){const r=yu(t.focus,!0);if(!e.shiftKey&&rt(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},He),n.registerCommand(sv,e=>{const t=fe();if(kt(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectNext(0,0),!0}else if(ae(t)){if((function(i){const o=i.focus;return o.key==="root"&&o.offset===Mt().getChildrenSize()})(t))return e.preventDefault(),!0;const r=yu(t.focus,!1);if(!e.shiftKey&&rt(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},He),n.registerCommand(iv,e=>{const t=fe();if(kt(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),gf(r[0])?r[0].selectNext(0,0):r[0].selectPrevious(),!0}if(!ae(t))return!1;if(hf(t,!0)){const r=e.shiftKey;return e.preventDefault(),vf(t,r,!0),!0}return!1},He),n.registerCommand(rv,e=>{const t=fe();if(kt(t)){const i=t.getNodes();if(i.length>0)return e.preventDefault(),gf(i[0])?i[0].selectPrevious():i[0].selectNext(0,0),!0}if(!ae(t))return!1;const r=e.shiftKey;return!!hf(t,!1)&&(e.preventDefault(),vf(t,r,!1),!0)},He),n.registerCommand(lv,e=>{if(Pf(e.target))return!1;const t=fe();if(ae(t)){if((function(r){if(!r.isCollapsed())return!1;const{anchor:i}=r;if(i.offset!==0)return!1;const o=i.getNode();if(Rt(o))return!1;const s=dp(o);return s.getIndent()>0&&(s.is(o)||o.is(s.getFirstDescendant()))})(t))return e.preventDefault(),n.dispatchCommand(Nd,void 0);if(Nf&&navigator.language==="ko-KR")return!1}else if(!kt(t))return!1;return e.preventDefault(),n.dispatchCommand(ei,!0)},He),n.registerCommand(uv,e=>{if(Pf(e.target))return!1;const t=fe();return!(!ae(t)&&!kt(t))&&(e.preventDefault(),n.dispatchCommand(ei,!1))},He),n.registerCommand(Xo,e=>{const t=fe();if(!ae(t))return!1;if(Tl(t),e!==null){if((Nf||gS||vS)&&fS)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(Vi,!1)}return n.dispatchCommand(Go,void 0)},He),n.registerCommand(sc,()=>{const e=fe();return!!ae(e)&&(n.blur(),!0)},He),n.registerCommand(dv,e=>{const[,t]=Ls(e);if(t.length>0){const i=Tf(e.clientX,e.clientY);if(i!==null){const{offset:o,node:s}=i,a=so(s);if(a!==null){const u=cc();if(pe(a))u.anchor.set(a.getKey(),o,"text"),u.focus.set(a.getKey(),o,"text");else{const d=a.getParentOrThrow().getKey(),f=a.getIndexWithinParent()+1;u.anchor.set(d,f,"element"),u.focus.set(d,f,"element")}const c=ro(u);Qt(c)}n.dispatchCommand(Af,t)}return e.preventDefault(),!0}const r=fe();return!!ae(r)},He),n.registerCommand(ac,e=>{const[t]=Ls(e),r=fe();return!(t&&!ae(r))},He),n.registerCommand(gv,e=>{const[t]=Ls(e),r=fe();if(t&&!ae(r))return!1;const i=Tf(e.clientX,e.clientY);if(i!==null){const o=so(i.node);rt(o)&&e.preventDefault()}return!0},He),n.registerCommand(lu,()=>(i2(),!0),He),n.registerCommand(za,e=>(bf(n,Ar(e,ClipboardEvent)?e:null),!0),He),n.registerCommand(lc,e=>((async function(t,r){await bf(r,Ar(t,ClipboardEvent)?t:null),r.update(()=>{const i=fe();ae(i)?i.removeText():kt(i)&&i.getNodes().forEach(o=>o.remove())})})(e,n),!0),He),n.registerCommand(Ia,e=>{const[,t,r]=Ls(e);return t.length>0&&!r?(n.dispatchCommand(Af,t),!0):xo(e.target)&&yc(e.target)?!1:fe()!==null&&((function(i,o){i.preventDefault(),o.update(()=>{const s=fe(),a=Ar(i,InputEvent)||Ar(i,KeyboardEvent)?null:i.clipboardData;a!=null&&s!==null&&mf(a,s,o)},{tag:Iw})})(e,n),!0)},He),n.registerCommand(av,e=>{const t=fe();return ae(t)&&Tl(t),!1},He),n.registerCommand(cv,e=>{const t=fe();return ae(t)&&Tl(t),!1},He))}function bS(n,e){ce(e,!0);const t=zm(),r=fn(),i={},o=[];ht(()=>{const s=[];return r._nodes.forEach(a=>{if(a.klass.prototype instanceof xi&&!a.klass.skipDecorateRender){let u=r.registerMutationListener(a.klass,(c,d)=>{for(let[f,g]of c)g==="destroyed"?delete i[f]:o.push(f)});s.push(u)}}),lr(...s,r.registerDecoratorListener(a=>{o.forEach(u=>{const c=a[u],d=i[u],f=r.getElementByKey(u);if(f?.innerHTML&&d){const g=i[u];c.updateProps(g)}else if(f){const g=Be({});c.updateProps(g),i[u]=g,gh(c.componentClass,{target:f,props:g,context:t})}}),o.length=0}))}),de()}function Sp(n,e){ce(e,!1);const t=fn();ht(()=>_S(t)),os(),bS(n,{}),de()}function yS(n,e,t,r,i){if(n===null||t.size===0&&r.size===0&&!i)return 0;const o=e._selection,s=n._selection;if(i)return 1;if(!(ae(o)&&ae(s)&&s.isCollapsed()&&o.isCollapsed()))return 0;const a=(function(x,_,S){const k=x._nodeMap,b=[];for(const C of _){const T=k.get(C);T!==void 0&&b.push(T)}for(const[C,T]of S){if(!T)continue;const O=k.get(C);O===void 0||Rt(O)||b.push(O)}return b})(e,t,r);if(a.length===0)return 0;if(a.length>1){const x=e._nodeMap,_=x.get(o.anchor.key),S=x.get(s.anchor.key);return _&&S&&!n._nodeMap.has(_.__key)&&pe(_)&&_.__text.length===1&&o.anchor.offset===1?2:0}const u=a[0],c=n._nodeMap.get(u.__key);if(!pe(c)||!pe(u)||c.__mode!==u.__mode)return 0;const d=c.__text,f=u.__text;if(d===f)return 0;const g=o.anchor,p=s.anchor;if(g.key!==p.key||g.type!=="text")return 0;const v=g.offset,m=p.offset,h=f.length-d.length;return h===1&&m===v-1?2:h===-1&&m===v+1?3:h===-1&&m===v?4:0}function xS(n,e){let t=Date.now(),r=0;return(i,o,s,a,u,c)=>{const d=Date.now();if(c.has(pu))return r=0,t=d,2;const f=yS(i,o,a,u,n.isComposing()),g=(()=>{const p=s===null||s.editor===n,v=c.has(Fw);if(!v&&p&&c.has(ti))return 0;if(i===null)return 1;const m=o._selection;if(!(a.size>0||u.size>0))return m!==null?0:2;const h=typeof e=="number"?e:e.peek();return v===!1&&f!==0&&f===r&&d<t+h&&p||a.size===1&&(function(x,_,S){const k=_._nodeMap.get(x),b=S._nodeMap.get(x),C=_._selection,T=S._selection;return!(ae(C)&&ae(T)&&C.anchor.type==="element"&&C.focus.type==="element"&&T.anchor.type==="text"&&T.focus.type==="text"||!pe(k)||!pe(b)||k.__parent!==b.__parent)&&JSON.stringify(_.read(()=>k.exportJSON()))===JSON.stringify(S.read(()=>b.exportJSON()))})(Array.from(a)[0],i,o)?0:1})();return t=d,r=f,g}}function Df(n){n.undoStack=[],n.redoStack=[],n.current=null}function kp(n,e,t){const r=xS(n,t);return lr(n.registerCommand(La,()=>((function(o,s){const a=s.redoStack,u=s.undoStack;if(u.length!==0){const c=s.current,d=u.pop();c!==null&&(a.push(c),o.dispatchCommand(Ns,!0)),u.length===0&&o.dispatchCommand(As,!1),s.current=d||null,d&&d.editor.setEditorState(d.editorState,{tag:pu})}})(n,e),!0),He),n.registerCommand(Ra,()=>((function(o,s){const a=s.redoStack,u=s.undoStack;if(a.length!==0){const c=s.current;c!==null&&(u.push(c),o.dispatchCommand(As,!0));const d=a.pop();a.length===0&&o.dispatchCommand(Ns,!1),s.current=d||null,d&&d.editor.setEditorState(d.editorState,{tag:pu})}})(n,e),!0),He),n.registerCommand(Sw,()=>(Df(e),!1),He),n.registerCommand(kw,()=>(Df(e),n.dispatchCommand(Ns,!1),n.dispatchCommand(As,!1),!0),He),n.registerUpdateListener(({editorState:o,prevEditorState:s,dirtyLeaves:a,dirtyElements:u,tags:c})=>{const d=e.current,f=e.redoStack,g=e.undoStack,p=d===null?null:d.editorState;if(d!==null&&o===p)return;const v=r(s,o,d,a,u,c);if(v===1)f.length!==0&&(e.redoStack=[],n.dispatchCommand(Ns,!1)),d!==null&&(g.push({...d}),n.dispatchCommand(As,!0));else if(v===2)return;e.current={editor:n,editorState:o}}))}function Bc(){return{current:null,redoStack:[],undoStack:[]}}const Nl={build:(n,{delay:e,createInitialHistoryState:t,disabled:r})=>G2({delay:e,disabled:r,historyState:t(n)}),config:{createInitialHistoryState:Bc,delay:300,disabled:typeof window>"u"},name:"@lexical/history/History",register:(n,e,t)=>{const r=t.getOutput();return Lc(()=>r.disabled.value?void 0:kp(n,r.historyState.value,r.delay))}};C2(Nl,{createInitialHistoryState:()=>{throw new Error("SharedHistory did not inherit parent history")},disabled:!0});function wS(n,e){ce(e,!0);const t=fn();let r=se(e,"externalHistoryState",19,Bc),i=se(e,"delay",3,1e3);ht(()=>kp(t,r(),i())),de()}function Or(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function SS(n){let e=1,t=n.getParent();for(;t!=null;){if(bt(t)){const r=t.getParent();if($e(r)){e++,t=r.getParent();continue}Or(40)}return e}return e}function Nu(n){let e=n.getParent();$e(e)||Or(40);let t=e;for(;t!==null;)t=t.getParent(),$e(t)&&(e=t);return e}function Cp(n){let e=[];const t=n.getChildren().filter(bt);for(let r=0;r<t.length;r++){const i=t[r],o=i.getFirstChild();$e(o)?e=e.concat(Cp(o)):e.push(i)}return e}function Jn(n){return bt(n)&&$e(n.getFirstChild())}function Ff(n){return On().append(n)}function Ep(n,e){return bt(n)&&(e.length===0||e.length===1&&n.is(e[0])&&n.getChildrenSize()===0)}function If(n){const e=fe();if(e!==null){let t=e.getNodes();if(ae(e)){const i=e.getStartEndPoints();i===null&&Or(143);const[o]=i,s=o.getNode(),a=s.getParent();if(cn(s)){const u=s.getFirstChild();if(u)t=u.selectStart().getNodes();else{const c=xt();s.append(c),t=c.select().getNodes()}}else if(Ep(s,t)){const u=mn(n);if(cn(a)){s.replace(u);const c=On();oe(s)&&(c.setFormat(s.getFormatType()),c.setIndent(s.getIndent())),u.append(c)}else if(bt(s)){const c=s.getParentOrThrow();gi(u,c.getChildren()),c.replace(u)}return}}const r=new Set;for(let i=0;i<t.length;i++){const o=t[i];if(oe(o)&&o.isEmpty()&&!bt(o)&&!r.has(o.getKey())){Lf(o,n);continue}let s=Uv(o)?o.getParent():bt(o)&&o.isEmpty()?o:null;for(;s!=null;){const a=s.getKey();if($e(s)){if(!r.has(a)){const u=mn(n);gi(u,s.getChildren()),s.replace(u),r.add(a)}break}{const u=s.getParent();if(cn(u)&&!r.has(a)){r.add(a),Lf(s,n);break}s=u}}}}}function gi(n,e){n.splice(n.getChildrenSize(),0,e)}function Lf(n,e){if($e(n))return n;const t=n.getPreviousSibling(),r=n.getNextSibling(),i=On();let o;if(gi(i,n.getChildren()),$e(t)&&e===t.getListType())t.append(i),$e(r)&&e===r.getListType()&&(gi(t,r.getChildren()),r.remove()),o=t;else if($e(r)&&e===r.getListType())r.getFirstChildOrThrow().insertBefore(i),o=r;else{const a=mn(e);a.append(i),n.replace(a),o=a}i.setFormat(n.getFormatType()),i.setIndent(n.getIndent());const s=fe();return ae(s)&&(o.getKey()===s.anchor.key&&s.anchor.set(i.getKey(),s.anchor.offset,"element"),o.getKey()===s.focus.key&&s.focus.set(i.getKey(),s.focus.offset,"element")),n.remove(),o}function Uc(n,e){const t=n.getLastChild(),r=e.getFirstChild();t&&r&&Jn(t)&&Jn(r)&&(Uc(t.getFirstChild(),r.getFirstChild()),r.remove());const i=e.getChildren();i.length>0&&n.append(...i),e.remove()}function kS(){const n=fe();if(ae(n)){const e=new Set,t=n.getNodes(),r=n.anchor.getNode();if(Ep(r,t))e.add(Nu(r));else for(let i=0;i<t.length;i++){const o=t[i];if(Uv(o)){const s=cp(o,ps);s!=null&&e.add(Nu(s))}}for(const i of e){let o=i;const s=Cp(i);for(const a of s){const u=xt().setTextStyle(n.style).setTextFormat(n.format);gi(u,a.getChildren()),o.insertAfter(u),o=u,a.__key===n.anchor.key&&fi(n.anchor,Sn(Un(u,"next"))),a.__key===n.focus.key&&fi(n.focus,Sn(Un(u,"next"))),a.remove()}i.remove()}}}function Tp(n){const e=n.getListType()!=="check";let t=n.getStart();for(const r of n.getChildren())bt(r)&&(r.getValue()!==t&&r.setValue(t),e&&r.getLatest().__checked!=null&&r.setChecked(void 0),$e(r.getFirstChild())||t++)}function CS(n){const e=new Set;if(Jn(n)||e.has(n.getKey()))return;const t=n.getParent(),r=n.getNextSibling(),i=n.getPreviousSibling();if(Jn(r)&&Jn(i)){const o=i.getFirstChild();if($e(o)){o.append(n);const s=r.getFirstChild();$e(s)&&(gi(o,s.getChildren()),r.remove(),e.add(r.getKey()))}}else if(Jn(r)){const o=r.getFirstChild();if($e(o)){const s=o.getFirstChild();s!==null&&s.insertBefore(n)}}else if(Jn(i)){const o=i.getFirstChild();$e(o)&&o.append(n)}else if($e(t)){const o=On().setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle()),s=mn(t.getListType()).setTextFormat(t.getTextFormat()).setTextStyle(t.getTextStyle());o.append(s),s.append(n),i?i.insertAfter(o):r?r.insertBefore(o):t.append(o)}}function ES(n){if(Jn(n))return;const e=n.getParent(),t=e?e.getParent():void 0;if($e(t?t.getParent():void 0)&&bt(t)&&$e(e)){const r=e?e.getFirstChild():void 0,i=e?e.getLastChild():void 0;if(n.is(r))t.insertBefore(n),e.isEmpty()&&t.remove();else if(n.is(i))t.insertAfter(n),e.isEmpty()&&t.remove();else{const o=e.getListType(),s=On(),a=mn(o);s.append(a),n.getPreviousSiblings().forEach(d=>a.append(d));const u=On(),c=mn(o);u.append(c),gi(c,n.getNextSiblings()),t.insertBefore(s),t.insertAfter(u),t.replace(n)}}}function TS(){const n=fe();if(!ae(n)||!n.isCollapsed())return!1;const e=n.anchor.getNode();let t=null;if(bt(e)&&e.getChildrenSize()===0)t=e;else if(pe(e)){const u=e.getParent();bt(u)&&u.getChildren().every(c=>pe(c)&&c.getTextContent().trim()==="")&&(t=u)}if(t===null)return!1;const r=Nu(t),i=t.getParent();$e(i)||Or(40);const o=i.getParent();let s;if(cn(o))s=xt(),r.insertAfter(s);else{if(!bt(o))return!1;s=On(),o.insertAfter(s)}s.setTextStyle(n.style).setTextFormat(n.format).select();const a=t.getNextSiblings();if(a.length>0){const u=mn(i.getListType());if(bt(s)){const c=On();c.append(u),s.insertAfter(c)}else s.insertAfter(u);u.append(...a)}return(function(u){let c=u;for(;c.getNextSibling()==null&&c.getPreviousSibling()==null;){const d=c.getParent();if(d==null||!bt(d)&&!$e(d))break;c=d}c.remove()})(t),!0}class ps extends bn{__value;__checked;$config(){return this.config("listitem",{$transform:e=>{if(e.__checked==null)return;const t=e.getParent();$e(t)&&t.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0)},extends:bn,importDOM:{li:()=>({conversion:NS,priority:0})}})}constructor(e=1,t=void 0,r){super(r),this.__value=e===void 0?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){const t=document.createElement("li");return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,r){(function(s,a,u){const c=a.getParent();!$e(c)||c.getListType()!=="check"||$e(a.getFirstChild())?(s.removeAttribute("role"),s.removeAttribute("tabIndex"),s.removeAttribute("aria-checked")):(s.setAttribute("role","checkbox"),s.setAttribute("tabIndex","-1"),u&&a.__checked===u.__checked||s.setAttribute("aria-checked",a.getChecked()?"true":"false"))})(t,this,e),t.value=this.__value,(function(s,a,u){const c=[],d=[],f=a.list,g=f?f.listitem:void 0;let p;if(f&&f.nested&&(p=f.nested.listitem),g!==void 0&&c.push(...Ur(g)),f){const v=u.getParent(),m=$e(v)&&v.getListType()==="check",h=u.getChecked();m&&!h||d.push(f.listitemUnchecked),m&&h||d.push(f.listitemChecked),m&&c.push(h?f.listitemChecked:f.listitemUnchecked)}if(p!==void 0){const v=Ur(p);u.getChildren().some(m=>$e(m))?c.push(...v):d.push(...v)}d.length>0&&Fc(s,...d),c.length>0&&ar(s,...c)})(t,r.theme,this);const i=e?e.__style:"",o=this.__style;i!==o&&(o===""?t.removeAttribute("style"):t.style.cssText=o),(function(s,a,u){const c=ff(a.__textStyle);for(const d in c)s.style.setProperty(`--listitem-marker-${d}`,c[d]);if(u)for(const d in ff(u.__textStyle))d in c||s.style.removeProperty(`--listitem-marker-${d}`)})(t,this,e)}updateDOM(e,t,r){const i=t;return this.updateListItemDOM(e,i,r),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){const t=this.createDOM(e._config),r=this.getFormatType();r&&(t.style.textAlign=r);const i=this.getDirection();return i&&(t.dir=i),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){const r=e[t];if(oe(r)&&this.canMergeWith(r)){const i=r.getChildren();this.append(...i),r.remove()}else super.append(r)}return this}replace(e,t){if(bt(e))return super.replace(e);this.setIndent(0);const r=this.getParentOrThrow();if(!$e(r))return e;if(r.__first===this.getKey())r.insertBefore(e);else if(r.__last===this.getKey())r.insertAfter(e);else{const i=mn(r.getListType());let o=this.getNextSibling();for(;o;){const s=o;o=o.getNextSibling(),i.append(s)}r.insertAfter(e),e.insertAfter(i)}return t&&(oe(e)||Or(139),this.getChildren().forEach(i=>{e.append(i)})),this.remove(),r.getChildrenSize()===0&&r.remove(),e}insertAfter(e,t=!0){const r=this.getParentOrThrow();if($e(r)||Or(39),bt(e))return super.insertAfter(e,t);const i=this.getNextSiblings();if(r.insertAfter(e,t),i.length!==0){const o=mn(r.getListType());i.forEach(s=>o.append(s)),e.insertAfter(o,t)}return e}remove(e){const t=this.getPreviousSibling(),r=this.getNextSibling();super.remove(e),t&&r&&Jn(t)&&Jn(r)&&(Uc(t.getFirstChild(),r.getFirstChild()),r.remove())}insertNewAfter(e,t=!0){const r=On().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(r,t),r}collapseAtStart(e){const t=xt();this.getChildren().forEach(s=>t.append(s));const r=this.getParentOrThrow(),i=r.getParentOrThrow(),o=bt(i);if(r.getChildrenSize()===1)if(o)r.remove(),i.select();else{r.insertBefore(t),r.remove();const s=e.anchor,a=e.focus,u=t.getKey();s.type==="element"&&s.getNode().is(this)&&s.set(u,s.offset,"element"),a.type==="element"&&a.getNode().is(this)&&a.set(u,a.offset,"element")}else r.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){const t=this.getWritable();return t.__value=e,t}getChecked(){const e=this.getLatest();let t;const r=this.getParent();return $e(r)&&(t=r.getListType()),t==="check"?!!e.__checked:void 0}setChecked(e){const t=this.getWritable();return t.__checked=e,t}toggleChecked(){const e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){const e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),r=0;for(;bt(t);)t=t.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(e){typeof e!="number"&&Or(117),(e=Math.floor(e))>=0||Or(199);let t=this.getIndent();for(;t!==e;)t<e?(CS(this),t++):(ES(this),t--);return this}canInsertAfter(e){return bt(e)}canReplaceWith(e){return bt(e)}canMergeWith(e){return bt(e)||pc(e)}extractWithChild(e,t){if(!ae(t))return!1;const r=t.anchor.getNode(),i=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return mn("bullet")}canMergeWhenEmpty(){return!0}}function NS(n){if(n.classList.contains("task-list-item")){for(const t of n.children)if(t.tagName==="INPUT")return Rf(t)}if(n.classList.contains("joplin-checkbox")){for(const t of n.children)if(t.classList.contains("checkbox-wrapper")&&t.children.length>0&&t.children[0].tagName==="INPUT")return Rf(t.children[0])}const e=n.getAttribute("aria-checked");return{node:On(e==="true"||e!=="false"&&void 0)}}function Rf(n){return n.getAttribute("type")!=="checkbox"?{node:null}:{node:On(n.hasAttribute("checked"))}}function On(n){return dn(new ps(void 0,n))}function bt(n){return n instanceof ps}class Za extends bn{__tag;__start;__listType;$config(){return this.config("list",{$transform:e=>{(function(t){const r=t.getNextSibling();$e(r)&&t.getListType()===r.getListType()&&Uc(t,r)})(e),Tp(e)},extends:bn,importDOM:{ol:()=>({conversion:Bf,priority:0}),ul:()=>({conversion:Bf,priority:0})}})}constructor(e="number",t=1,r){super(r);const i=OS[e]||e;this.__listType=i,this.__tag=i==="number"?"ol":"ul",this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){const t=this.getWritable();return t.__listType=e,t.__tag=e==="number"?"ol":"ul",t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){const t=this.getWritable();return t.__start=e,t}createDOM(e,t){const r=this.__tag,i=document.createElement(r);return this.__start!==1&&i.setAttribute("start",String(this.__start)),i.__lexicalListType=this.__listType,zf(i,e.theme,this),i}updateDOM(e,t,r){return e.__tag!==this.__tag||e.__listType!==this.__listType||(zf(t,r.theme,this),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){const t=this.createDOM(e._config,e);return Ft(t)&&(this.__start!==1&&t.setAttribute("start",String(this.__start)),this.__listType==="check"&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,r){let i=r;for(let o=0;o<r.length;o++){const s=r[o];bt(s)||(i===r&&(i=[...r]),i[o]=On().append(!oe(s)||$e(s)||s.isInline()?s:Bt(s.getTextContent())))}return super.splice(e,t,i)}extractWithChild(e){return bt(e)}}function zf(n,e,t){const r=[],i=[],o=e.list;if(o!==void 0){const s=o[`${t.__tag}Depth`]||[],a=SS(t)-1,u=a%s.length,c=s[u],d=o[t.__tag];let f;const g=o.nested,p=o.checklist;if(g!==void 0&&g.list&&(f=g.list),d!==void 0&&r.push(d),p!==void 0&&t.__listType==="check"&&r.push(p),c!==void 0){r.push(...Ur(c));for(let v=0;v<s.length;v++)v!==u&&i.push(t.__tag+v)}if(f!==void 0){const v=Ur(f);a>1?r.push(...v):i.push(...v)}}i.length>0&&Fc(n,...i),r.length>0&&ar(n,...r)}function AS(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t];if(bt(r)){e.push(r);const i=r.getChildren();i.length>1&&i.forEach(o=>{$e(o)&&e.push(Ff(o))})}else e.push(Ff(r))}return e}function Bf(n){const e=n.nodeName.toLowerCase();let t=null;return e==="ol"?t=mn("number",n.start):e==="ul"&&(t=(function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list")||r.getAttribute("data-is-checklist")==="1")return!0;for(const i of r.childNodes)if(Ft(i)&&i.hasAttribute("aria-checked"))return!0;return!1})(n)?mn("check"):mn("bullet")),{after:AS,node:t}}const OS={ol:"number",ul:"bullet"};function mn(n="number",e=1){return dn(new Za(n,e))}function $e(n){return n instanceof Za}const MS=Ae("UPDATE_LIST_START_COMMAND"),Np=Ae("INSERT_UNORDERED_LIST_COMMAND"),Ap=Ae("INSERT_ORDERED_LIST_COMMAND"),PS=Ae("REMOVE_LIST_COMMAND");function DS(n){return lr(n.registerCommand(Ap,()=>(If("number"),!0),rn),n.registerCommand(MS,e=>{const{listNodeKey:t,newStart:r}=e,i=yt(t);return!!$e(i)&&(i.getListType()==="number"&&(i.setStart(r),Tp(i)),!0)},rn),n.registerCommand(Np,()=>(If("bullet"),!0),rn),n.registerCommand(PS,()=>(kS(),!0),rn),n.registerCommand(Go,()=>TS(),rn),n.registerNodeTransform(ps,e=>{const t=e.getFirstChild();if(t){if(pe(t)){const r=t.getStyle(),i=t.getFormat();e.getTextStyle()!==r&&e.setTextStyle(r),e.getTextFormat()!==i&&e.setTextFormat(i)}}else{const r=fe();ae(r)&&(r.style!==e.getTextStyle()||r.format!==e.getTextFormat())&&r.isCollapsed()&&e.is(r.anchor.getNode())&&e.setTextStyle(r.style).setTextFormat(r.format)}}),n.registerNodeTransform(Mn,e=>{const t=e.getParent();if(bt(t)&&e.is(t.getFirstChild())){const r=e.getStyle(),i=e.getFormat();r===t.getTextStyle()&&i===t.getTextFormat()||t.setTextStyle(r).setTextFormat(i)}}))}function FS(n,e){ce(e,!1);const t=fn();ht(()=>DS(t)),os(),de()}function IS(n,e){return n.getEditorState().read(()=>{const t=yt(e);return t===null?!1:t.isSelected()})}function Op(n){n.update(()=>{const e=fe();kt(e)&&e.clear()})}function Mp(n,e){const{subscribe:t,set:r}=Ru(!1);return n.registerUpdateListener(()=>{r(IS(n,e))}),{subscribe:t,set:i=>{n.update(()=>{let o=fe();kt(o)||(o=dc(),Qt(o)),kt(o)&&(i?o.add(e):o.delete(e))})}}}var LS=M('<button type="button" class="image-caption-button">Add Caption</button>'),RS=M('<div><!> <div class="image-resizer image-resizer-n"></div> <div class="image-resizer image-resizer-ne"></div> <div class="image-resizer image-resizer-e"></div> <div class="image-resizer image-resizer-se"></div> <div class="image-resizer image-resizer-s"></div> <div class="image-resizer image-resizer-sw"></div> <div class="image-resizer image-resizer-w"></div> <div class="image-resizer image-resizer-nw"></div></div>');function zS(n,e){ce(e,!0);const t=()=>ji(e.buttonRef,"$buttonRef",r),[r,i]=Ca();let o=X(null);function s(P,K,Q){return Math.min(Math.max(P,K),Q)}const a={east:1,north:8,south:2,west:4},u={priority:"",value:"default"},c={currentHeight:0,currentWidth:0,direction:0,isResizing:!1,ratio:0,startHeight:0,startWidth:0,startX:0,startY:0},d=e.editor.getRootElement(),f=e.maxWidth?e.maxWidth:d!==null?d.getBoundingClientRect().width-20:100,g=d!==null?d.getBoundingClientRect().height-20:100,p=100,v=100,m=P=>{const K=P===a.east||P===a.west,Q=P===a.north||P===a.south,ee=P&a.north&&P&a.west||P&a.south&&P&a.east,H=K?"ew":Q?"ns":ee?"nwse":"nesw";d!==null&&d.style.setProperty("cursor",`${H}-resize`,"important"),document.body!==null&&(document.body.style.setProperty("cursor",`${H}-resize`,"important"),u.value=document.body.style.getPropertyValue("-webkit-user-select"),u.priority=document.body.style.getPropertyPriority("-webkit-user-select"),document.body.style.setProperty("-webkit-user-select","none","important"))},h=()=>{d!==null&&d.style.setProperty("cursor","default"),document.body!==null&&(document.body.style.setProperty("cursor","default"),document.body.style.setProperty("-webkit-user-select",u.value,u.priority))},x=(P,K)=>{if(!e.editor.isEditable())return;const Q=e.imageRef,ee=l(o);if(Q!==null&&ee!==null){P.preventDefault();const{width:H,height:j}=Q.getBoundingClientRect(),ne=pf(Q),B=c;B.startWidth=H,B.startHeight=j,B.ratio=H/j,B.currentWidth=H,B.currentHeight=j,B.startX=P.clientX/ne,B.startY=P.clientY/ne,B.isResizing=!0,B.direction=K,m(K),e.onResizeStart(),ee.classList.add("image-control-wrapper--resizing"),Q.style.height=`${j}px`,Q.style.width=`${H}px`,document.addEventListener("pointermove",_),document.addEventListener("pointerup",S)}},_=P=>{const K=e.imageRef,Q=c,ee=Q.direction&(a.east|a.west),H=Q.direction&(a.south|a.north);if(K!==null&&Q.isResizing){const j=pf(K);if(ee&&H){let ne=Math.floor(Q.startX-P.clientX/j);ne=Q.direction&a.east?-ne:ne;const B=s(Q.startWidth+ne,p,f),z=B/Q.ratio;K.style.width=`${B}px`,K.style.height=`${z}px`,Q.currentHeight=z,Q.currentWidth=B}else if(H){let ne=Math.floor(Q.startY-P.clientY/j);ne=Q.direction&a.south?-ne:ne;const B=s(Q.startHeight+ne,v,g);K.style.height=`${B}px`,Q.currentHeight=B}else{let ne=Math.floor(Q.startX-P.clientX/j);ne=Q.direction&a.east?-ne:ne;const B=s(Q.startWidth+ne,p,f);K.style.width=`${B}px`,Q.currentWidth=B}}},S=()=>{const P=e.imageRef,K=c,Q=l(o);if(P!==null&&Q!==null&&K.isResizing){const ee=K.currentWidth,H=K.currentHeight;K.startWidth=0,K.startHeight=0,K.ratio=0,K.startX=0,K.startY=0,K.currentWidth=0,K.currentHeight=0,K.isResizing=!1,Q.classList.remove("image-control-wrapper--resizing"),h(),e.onResizeEnd(ee,H),document.removeEventListener("pointermove",_),document.removeEventListener("pointerup",S)}};var k=RS(),b=w(k);{var C=P=>{var K=LS();_n(K,Q=>Wi(e.buttonRef,Q),()=>t()),Z("click",K,()=>{e.setShowCaption(!e.showCaption)}),y(P,K)};W(b,P=>{!e.showCaption&&e.captionsEnabled&&P(C)})}var T=N(b,2),O=N(T,2),E=N(O,2),D=N(E,2),L=N(D,2),V=N(L,2),J=N(V,2),R=N(J,2);_n(k,P=>A(o,P),()=>l(o)),Z("pointerdown",T,P=>{x(P,a.north)}),Z("pointerdown",O,P=>{x(P,a.north|a.east)}),Z("pointerdown",E,P=>{x(P,a.east)}),Z("pointerdown",D,P=>{x(P,a.south|a.east)}),Z("pointerdown",L,P=>{x(P,a.south)}),Z("pointerdown",V,P=>{x(P,a.south|a.west)}),Z("pointerdown",J,P=>{x(P,a.west)}),Z("pointerdown",R,P=>{x(P,a.north|a.west)}),y(n,k),de(),i()}ve(["click","pointerdown"]);function BS(n,e){ce(e,!0);let t=se(e,"initialEditor",15),r=se(e,"initialTheme",3,null);function i(c){const d=c.transform();return d!==null?new Set([d]):new Set}pi("editor",t());const o=r()||e.parentEditor._config.theme;o&&t(t()._config.theme=o,!0),t(t()._parentEditor=e.parentEditor,!0);const s=t(t()._nodes=new Map(e.parentEditor._nodes),!0);for(const[c,d]of s)t()._nodes.set(c,{exportDOM:d.exportDOM,klass:d.klass,replace:d.replace,replaceWithKlass:d.replaceWithKlass,sharedNodeState:Jh(d.klass),transforms:i(d.klass)});t(t()._config.namespace=e.parentEditor._config.namespace,!0),t(t()._editable=e.parentEditor._editable,!0),ht(()=>e.parentEditor.registerEditableListener(c=>{t().setEditable(c)}));var a=te(),u=q(a);Dt(u,()=>e.children??Ot),y(n,a),de()}var US=M("<div></div>");function Pp(n,e){ce(e,!0);let t=se(e,"ariaActiveDescendantID",19,()=>{}),r=se(e,"ariaAutoComplete",3,null),i=se(e,"ariaControls",19,()=>{}),o=se(e,"ariaDescribedBy",19,()=>{}),s=se(e,"ariaExpanded",19,()=>{}),a=se(e,"ariaLabel",19,()=>{}),u=se(e,"ariaLabelledBy",19,()=>{}),c=se(e,"ariaMultiline",19,()=>{}),d=se(e,"ariaOwns",19,()=>{}),f=se(e,"ariaRequired",19,()=>{}),g=se(e,"autoCapitalize",19,()=>{}),p=se(e,"className",3,"ContentEditable__root"),v=se(e,"id",19,()=>{}),m=se(e,"role",3,"textbox"),h=se(e,"spellCheck",3,!0),x=se(e,"style",19,()=>{}),_=se(e,"tabIndex",19,()=>{}),S=se(e,"testid",19,()=>{}),k=X(!1);const b=fn();let C=X(null);ht(()=>(l(C)&&l(C).ownerDocument&&l(C).ownerDocument.defaultView?b.setRootElement(l(C)):b.setRootElement(null),A(k,b.isEditable(),!0),b.registerEditableListener(O=>{A(k,O,!0)})));var T=US();_n(T,O=>A(C,O),()=>l(C)),G(()=>{re(T,"aria-activedescendant",l(k)?t():void 0),re(T,"aria-autocomplete",l(k)?r():"none"),re(T,"aria-controls",l(k)?i():void 0),re(T,"aria-describedby",o()),re(T,"aria-expanded",l(k)&&m()==="combobox"?!!s():void 0),re(T,"aria-label",a()),re(T,"aria-labelledby",u()),re(T,"aria-multiline",c()),re(T,"aria-owns",l(k)?d():null),re(T,"aria-readonly",l(k)?void 0:!0),re(T,"aria-required",f()),re(T,"autocapitalize",g()),be(T,1,_t(p())),re(T,"contenteditable",l(k)),re(T,"data-testid",S()),re(T,"id",v()),re(T,"role",m()),re(T,"spellcheck",h()),Qn(T,x()),re(T,"tabindex",_())}),y(n,T),de()}function jS(){return Mt().getTextContent()}function WS(n,e=!0){if(n)return!1;let t=jS();return e&&(t=t.trim()),t===""}function KS(n){if(!WS(n,!1))return!1;const e=Mt().getChildren(),t=e.length;if(t>1)return!1;for(let r=0;r<t;r++){const i=e[r];if(rt(i))return!1;if(oe(i)){if(!pc(i)||i.__indent!==0)return!1;const o=i.getChildren(),s=o.length;for(let a=0;a<s;a++){const u=o[r];if(!pe(u))return!1}}}return!0}function HS(n){return()=>KS(n)}var VS=M("<div><!></div>");function JS(n,e){ce(e,!0);let t=se(e,"className",3,"Placeholder__root");const r=fn();let i=X(!0);ht(()=>lr(r.registerUpdateListener(()=>{A(i,o(r),!0)}),r.registerEditableListener(()=>{A(i,o(r),!0)})));function o(c){return c.getEditorState().read(HS(c.isComposing()))}var s=te(),a=q(s);{var u=c=>{var d=VS(),f=w(d);Dt(f,()=>e.children??Ot),G(()=>be(d,1,_t(t()),"svelte-aa2ayt")),y(c,d)};W(a,c=>{l(i)&&c(u)})}y(n,s),de()}var Uf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Al={exports:{}},jf;function qS(){return jf||(jf=1,(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var t=(function(r){var i=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,o=0,s={},a={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function _(S){return S instanceof u?new u(S.type,_(S.content),S.alias):Array.isArray(S)?S.map(_):S.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(_){return Object.prototype.toString.call(_).slice(8,-1)},objId:function(_){return _.__id||Object.defineProperty(_,"__id",{value:++o}),_.__id},clone:function _(S,k){k=k||{};var b,C;switch(a.util.type(S)){case"Object":if(C=a.util.objId(S),k[C])return k[C];b={},k[C]=b;for(var T in S)S.hasOwnProperty(T)&&(b[T]=_(S[T],k));return b;case"Array":return C=a.util.objId(S),k[C]?k[C]:(b=[],k[C]=b,S.forEach(function(O,E){b[E]=_(O,k)}),b);default:return S}},getLanguage:function(_){for(;_;){var S=i.exec(_.className);if(S)return S[1].toLowerCase();_=_.parentElement}return"none"},setLanguage:function(_,S){_.className=_.className.replace(RegExp(i,"gi"),""),_.classList.add("language-"+S)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(b){var _=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(b.stack)||[])[1];if(_){var S=document.getElementsByTagName("script");for(var k in S)if(S[k].src==_)return S[k]}return null}},isActive:function(_,S,k){for(var b="no-"+S;_;){var C=_.classList;if(C.contains(S))return!0;if(C.contains(b))return!1;_=_.parentElement}return!!k}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(_,S){var k=a.util.clone(a.languages[_]);for(var b in S)k[b]=S[b];return k},insertBefore:function(_,S,k,b){b=b||a.languages;var C=b[_],T={};for(var O in C)if(C.hasOwnProperty(O)){if(O==S)for(var E in k)k.hasOwnProperty(E)&&(T[E]=k[E]);k.hasOwnProperty(O)||(T[O]=C[O])}var D=b[_];return b[_]=T,a.languages.DFS(a.languages,function(L,V){V===D&&L!=_&&(this[L]=T)}),T},DFS:function _(S,k,b,C){C=C||{};var T=a.util.objId;for(var O in S)if(S.hasOwnProperty(O)){k.call(S,O,S[O],b||O);var E=S[O],D=a.util.type(E);D==="Object"&&!C[T(E)]?(C[T(E)]=!0,_(E,k,null,C)):D==="Array"&&!C[T(E)]&&(C[T(E)]=!0,_(E,k,O,C))}}},plugins:{},highlightAll:function(_,S){a.highlightAllUnder(document,_,S)},highlightAllUnder:function(_,S,k){var b={callback:k,container:_,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",b),b.elements=Array.prototype.slice.apply(b.container.querySelectorAll(b.selector)),a.hooks.run("before-all-elements-highlight",b);for(var C=0,T;T=b.elements[C++];)a.highlightElement(T,S===!0,b.callback)},highlightElement:function(_,S,k){var b=a.util.getLanguage(_),C=a.languages[b];a.util.setLanguage(_,b);var T=_.parentElement;T&&T.nodeName.toLowerCase()==="pre"&&a.util.setLanguage(T,b);var O=_.textContent,E={element:_,language:b,grammar:C,code:O};function D(V){E.highlightedCode=V,a.hooks.run("before-insert",E),E.element.innerHTML=E.highlightedCode,a.hooks.run("after-highlight",E),a.hooks.run("complete",E),k&&k.call(E.element)}if(a.hooks.run("before-sanity-check",E),T=E.element.parentElement,T&&T.nodeName.toLowerCase()==="pre"&&!T.hasAttribute("tabindex")&&T.setAttribute("tabindex","0"),!E.code){a.hooks.run("complete",E),k&&k.call(E.element);return}if(a.hooks.run("before-highlight",E),!E.grammar){D(a.util.encode(E.code));return}if(S&&r.Worker){var L=new Worker(a.filename);L.onmessage=function(V){D(V.data)},L.postMessage(JSON.stringify({language:E.language,code:E.code,immediateClose:!0}))}else D(a.highlight(E.code,E.grammar,E.language))},highlight:function(_,S,k){var b={code:_,grammar:S,language:k};if(a.hooks.run("before-tokenize",b),!b.grammar)throw new Error('The language "'+b.language+'" has no grammar.');return b.tokens=a.tokenize(b.code,b.grammar),a.hooks.run("after-tokenize",b),u.stringify(a.util.encode(b.tokens),b.language)},tokenize:function(_,S){var k=S.rest;if(k){for(var b in k)S[b]=k[b];delete S.rest}var C=new f;return g(C,C.head,_),d(_,C,S,C.head,0),v(C)},hooks:{all:{},add:function(_,S){var k=a.hooks.all;k[_]=k[_]||[],k[_].push(S)},run:function(_,S){var k=a.hooks.all[_];if(!(!k||!k.length))for(var b=0,C;C=k[b++];)C(S)}},Token:u};r.Prism=a;function u(_,S,k,b){this.type=_,this.content=S,this.alias=k,this.length=(b||"").length|0}u.stringify=function _(S,k){if(typeof S=="string")return S;if(Array.isArray(S)){var b="";return S.forEach(function(D){b+=_(D,k)}),b}var C={type:S.type,content:_(S.content,k),tag:"span",classes:["token",S.type],attributes:{},language:k},T=S.alias;T&&(Array.isArray(T)?Array.prototype.push.apply(C.classes,T):C.classes.push(T)),a.hooks.run("wrap",C);var O="";for(var E in C.attributes)O+=" "+E+'="'+(C.attributes[E]||"").replace(/"/g,""")+'"';return"<"+C.tag+' class="'+C.classes.join(" ")+'"'+O+">"+C.content+"</"+C.tag+">"};function c(_,S,k,b){_.lastIndex=S;var C=_.exec(k);if(C&&b&&C[1]){var T=C[1].length;C.index+=T,C[0]=C[0].slice(T)}return C}function d(_,S,k,b,C,T){for(var O in k)if(!(!k.hasOwnProperty(O)||!k[O])){var E=k[O];E=Array.isArray(E)?E:[E];for(var D=0;D<E.length;++D){if(T&&T.cause==O+","+D)return;var L=E[D],V=L.inside,J=!!L.lookbehind,R=!!L.greedy,P=L.alias;if(R&&!L.pattern.global){var K=L.pattern.toString().match(/[imsuy]*$/)[0];L.pattern=RegExp(L.pattern.source,K+"g")}for(var Q=L.pattern||L,ee=b.next,H=C;ee!==S.tail&&!(T&&H>=T.reach);H+=ee.value.length,ee=ee.next){var j=ee.value;if(S.length>_.length)return;if(!(j instanceof u)){var ne=1,B;if(R){if(B=c(Q,H,_,J),!B||B.index>=_.length)break;var Y=B.index,z=B.index+B[0].length,F=H;for(F+=ee.value.length;Y>=F;)ee=ee.next,F+=ee.value.length;if(F-=ee.value.length,H=F,ee.value instanceof u)continue;for(var I=ee;I!==S.tail&&(F<z||typeof I.value=="string");I=I.next)ne++,F+=I.value.length;ne--,j=_.slice(H,F),B.index-=H}else if(B=c(Q,0,j,J),!B)continue;var Y=B.index,ie=B[0],ue=j.slice(0,Y),we=j.slice(Y+ie.length),me=H+j.length;T&&me>T.reach&&(T.reach=me);var ge=ee.prev;ue&&(ge=g(S,ge,ue),H+=ue.length),p(S,ge,ne);var Te=new u(O,V?a.tokenize(ie,V):ie,P,ie);if(ee=g(S,ge,Te),we&&g(S,ee,we),ne>1){var Ne={cause:O+","+D,reach:me};d(_,S,k,ee.prev,H,Ne),T&&Ne.reach>T.reach&&(T.reach=Ne.reach)}}}}}}function f(){var _={value:null,prev:null,next:null},S={value:null,prev:_,next:null};_.next=S,this.head=_,this.tail=S,this.length=0}function g(_,S,k){var b=S.next,C={value:k,prev:S,next:b};return S.next=C,b.prev=C,_.length++,C}function p(_,S,k){for(var b=S.next,C=0;C<k&&b!==_.tail;C++)b=b.next;S.next=b,b.prev=S,_.length-=C}function v(_){for(var S=[],k=_.head.next;k!==_.tail;)S.push(k.value),k=k.next;return S}if(!r.document)return r.addEventListener&&(a.disableWorkerMessageHandler||r.addEventListener("message",function(_){var S=JSON.parse(_.data),k=S.language,b=S.code,C=S.immediateClose;r.postMessage(a.highlight(b,a.languages[k],k)),C&&r.close()},!1)),a;var m=a.util.currentScript();m&&(a.filename=m.src,m.hasAttribute("data-manual")&&(a.manual=!0));function h(){a.manual||a.highlightAll()}if(!a.manual){var x=document.readyState;x==="loading"||x==="interactive"&&m&&m.defer?document.addEventListener("DOMContentLoaded",h):window.requestAnimationFrame?window.requestAnimationFrame(h):window.setTimeout(h,16)}return a})(e);n.exports&&(n.exports=t),typeof Uf<"u"&&(Uf.Prism=t),t.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(i,o){var s={};s["language-"+o]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:t.languages[o]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var a={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};a["language-"+o]={pattern:/[\s\S]+/,inside:t.languages[o]};var u={};u[i]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return i}),"i"),lookbehind:!0,greedy:!0,inside:a},t.languages.insertBefore("markup","cdata",u)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(r,i){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[i,"language-"+i],inside:t.languages[i]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,(function(r){var i=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+i.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+i.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+i.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+i.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:i,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var o=r.languages.markup;o&&(o.tag.addInlined("style","css"),o.tag.addAttribute("style","css"))})(t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),t.languages.js=t.languages.javascript,(function(){if(typeof t>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",i=function(m,h){return"✖ Error "+m+" while fetching file: "+h},o="✖ Error: File does not exist or is empty",s={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},a="data-src-status",u="loading",c="loaded",d="failed",f="pre[data-src]:not(["+a+'="'+c+'"]):not(['+a+'="'+u+'"])';function g(m,h,x){var _=new XMLHttpRequest;_.open("GET",m,!0),_.onreadystatechange=function(){_.readyState==4&&(_.status<400&&_.responseText?h(_.responseText):_.status>=400?x(i(_.status,_.statusText)):x(o))},_.send(null)}function p(m){var h=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(m||"");if(h){var x=Number(h[1]),_=h[2],S=h[3];return _?S?[x,Number(S)]:[x,void 0]:[x,x]}}t.hooks.add("before-highlightall",function(m){m.selector+=", "+f}),t.hooks.add("before-sanity-check",function(m){var h=m.element;if(h.matches(f)){m.code="",h.setAttribute(a,u);var x=h.appendChild(document.createElement("CODE"));x.textContent=r;var _=h.getAttribute("data-src"),S=m.language;if(S==="none"){var k=(/\.(\w+)$/.exec(_)||[,"none"])[1];S=s[k]||k}t.util.setLanguage(x,S),t.util.setLanguage(h,S);var b=t.plugins.autoloader;b&&b.loadLanguages(S),g(_,function(C){h.setAttribute(a,c);var T=p(h.getAttribute("data-range"));if(T){var O=C.split(/\r\n?|\n/g),E=T[0],D=T[1]==null?O.length:T[1];E<0&&(E+=O.length),E=Math.max(0,Math.min(E-1,O.length)),D<0&&(D+=O.length),D=Math.max(0,Math.min(D,O.length)),C=O.slice(E,D).join(`
|
|
27
|
-
`),h.hasAttribute("data-start")||h.setAttribute("data-start",String(E+1))}x.textContent=C,t.highlightElement(x)},function(C){h.setAttribute(a,d),x.textContent=C})}}),t.plugins.fileHighlight={highlight:function(h){for(var x=(h||document).querySelectorAll(f),_=0,S;S=x[_++];)t.highlightElement(S)}};var v=!1;t.fileHighlight=function(){v||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),v=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}})()})(Al)),Al.exports}qS();Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));Prism.languages.js=Prism.languages.javascript;Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity;Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup;Prism.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.replace(/&/,"&"))});Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var r={};r["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};i["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var o={};o[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:i},Prism.languages.insertBefore("markup","cdata",o)}});Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(n,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Prism.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});Prism.languages.html=Prism.languages.markup;Prism.languages.mathml=Prism.languages.markup;Prism.languages.svg=Prism.languages.markup;Prism.languages.xml=Prism.languages.extend("markup",{});Prism.languages.ssml=Prism.languages.xml;Prism.languages.atom=Prism.languages.xml;Prism.languages.rss=Prism.languages.xml;(function(n){var e=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function t(d){return d=d.replace(/<inner>/g,function(){return e}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+d+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;n.languages.markdown=n.languages.extend("markup",{}),n.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:n.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+o+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+o+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:n.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:t(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:t(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:t(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:t(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(d){["url","bold","italic","strike","code-snippet"].forEach(function(f){d!==f&&(n.languages.markdown[d].inside.content.inside[f]=n.languages.markdown[f])})}),n.hooks.add("after-tokenize",function(d){if(d.language!=="markdown"&&d.language!=="md")return;function f(g){if(!(!g||typeof g=="string"))for(var p=0,v=g.length;p<v;p++){var m=g[p];if(m.type!=="code"){f(m.content);continue}var h=m.content[1],x=m.content[3];if(h&&x&&h.type==="code-language"&&x.type==="code-block"&&typeof h.content=="string"){var _=h.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");_=(/[a-z][\w-]*/i.exec(_)||[""])[0].toLowerCase();var S="language-"+_;x.alias?typeof x.alias=="string"?x.alias=[x.alias,S]:x.alias.push(S):x.alias=[S]}}}f(d.tokens)}),n.hooks.add("wrap",function(d){if(d.type==="code-block"){for(var f="",g=0,p=d.classes.length;g<p;g++){var v=d.classes[g],m=/language-(.+)/.exec(v);if(m){f=m[1];break}}var h=n.languages[f];if(h)d.content=n.highlight(c(d.content),h,f);else if(f&&f!=="none"&&n.plugins.autoloader){var x="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);d.attributes.id=x,n.plugins.autoloader.loadLanguages(f,function(){var _=document.getElementById(x);_&&(_.innerHTML=n.highlight(_.textContent,n.languages[f],f))})}}});var s=RegExp(n.languages.markup.tag.pattern.source,"gi"),a={amp:"&",lt:"<",gt:">",quot:'"'},u=String.fromCodePoint||String.fromCharCode;function c(d){var f=d.replace(s,"");return f=f.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(g,p){if(p=p.toLowerCase(),p[0]==="#"){var v;return p[1]==="x"?v=parseInt(p.slice(2),16):v=Number(p.slice(1)),u(v)}else{var m=a[p];return m||g}}),f}n.languages.md=n.languages.markdown})(Prism);Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/});Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}});Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}});Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/});delete Prism.languages.c.boolean;(function(n){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var t=n.languages.markup;t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))})(Prism);Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/});delete Prism.languages.objectivec["class-name"];Prism.languages.objc=Prism.languages.objectivec;Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};(function(n){var e=n.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};e.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:e},boolean:e.boolean,variable:e.variable}})(Prism);var Wf={},Kf;function GS(){return Kf||(Kf=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),Wf}GS();var Hf={},Vf;function YS(){return Vf||(Vf=1,(function(n){for(var e=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,t=0;t<2;t++)e=e.replace(/<self>/g,function(){return e});e=e.replace(/<self>/g,function(){return/[^\s\S]/.source}),n.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+e),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},n.languages.rust["closure-params"].inside.rest=n.languages.rust,n.languages.rust.attribute.inside.string=n.languages.rust.string})(Prism)),Hf}YS();Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/};Prism.languages.swift["string-literal"].forEach(function(n){n.inside.interpolation.inside=Prism.languages.swift});var Jf={},qf;function ZS(){return qf||(qf=1,(function(n){n.languages.typescript=n.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),n.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete n.languages.typescript.parameter,delete n.languages.typescript["literal-property"];var e=n.languages.extend("typescript",{});delete e["class-name"],n.languages.typescript["class-name"].inside=e,n.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e}}}}),n.languages.ts=n.languages.typescript})(Prism)),Jf}ZS();var Gf={},Yf;function XS(){return Yf||(Yf=1,(function(n){var e=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,t=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+t+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};n.languages.java=n.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+t+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+t+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:e,function:[n.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),n.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),n.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+t+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+t+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism)),Gf}XS();var Zf={},Xf;function QS(){return Xf||(Xf=1,(function(n){var e=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,t=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return e.source});n.languages.cpp=n.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:e,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),n.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return t})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),n.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n.languages.cpp}}}}),n.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),n.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:n.languages.extend("cpp",{})}}),n.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},n.languages.cpp["base-clause"])})(Prism)),Zf}QS();function Dp(n,e){for(const t of n.childNodes){if(Ft(t)&&t.tagName===e)return!0;Dp(t,e)}return!1}const Po="data-language",No="data-highlight-language",Rs="data-theme";class ms extends bn{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(e){return new ms(e.__language,e.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){const t=document.createElement("code");ar(t,e.theme.code),t.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(t.setAttribute(Po,r),this.getIsSyntaxHighlightSupported()&&t.setAttribute(No,r));const i=this.getTheme();i&&t.setAttribute(Rs,i);const o=this.getStyle();return o&&t.setAttribute("style",o),t}updateDOM(e,t,r){const i=this.__language,o=e.__language;i?i!==o&&t.setAttribute(Po,i):o&&t.removeAttribute(Po);const s=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&o?s&&i?i!==o&&t.setAttribute(No,i):t.removeAttribute(No):s&&i&&t.setAttribute(No,i);const a=this.__theme,u=e.__theme;a?a!==u&&t.setAttribute(Rs,a):u&&t.removeAttribute(Rs);const c=this.__style,d=e.__style;return c?c!==d&&t.setAttribute("style",c):d&&t.removeAttribute("style"),!1}exportDOM(e){const t=document.createElement("pre");ar(t,e._config.theme.code),t.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(t.setAttribute(Po,r),this.getIsSyntaxHighlightSupported()&&t.setAttribute(No,r));const i=this.getTheme();i&&t.setAttribute(Rs,i);const o=this.getStyle();return o&&t.setAttribute("style",o),{element:t}}static importDOM(){return{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||Dp(e,"BR"))?{conversion:Qf,priority:1}:null,div:()=>({conversion:ek,priority:1}),pre:()=>({conversion:Qf,priority:0}),table:e=>Ol(e)?{conversion:tk,priority:3}:null,td:e=>{const t=e,r=t.closest("table");return t.classList.contains("js-file-line")||r&&Ol(r)?{conversion:$f,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&Ol(t)?{conversion:$f,priority:3}:null}}}static importJSON(e){return hi().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,t=!0){const r=this.getChildren(),i=r.length;if(i>=2&&r[i-1].getTextContent()===`
|
|
28
|
-
`&&r[i-2].getTextContent()===`
|
|
29
|
-
`&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===i){r[i-1].remove(),r[i-2].remove();const u=xt();return this.insertAfter(u,t),u}const{anchor:o,focus:s}=e,a=(o.isBefore(s)?o:s).getNode();if(pe(a)){let u=rk(a);const c=[];for(;;)if(Ba(u))c.push(bo()),u=u.getNextSibling();else{if(!Ip(u))break;{let h=0;const x=u.getTextContent(),_=u.getTextContentSize();for(;h<_&&x[h]===" ";)h++;if(h!==0&&c.push(Fp(" ".repeat(h))),h!==_)break;u=u.getNextSibling()}}const d=a.splitText(o.offset)[0],f=o.offset===0?0:1,g=d.getIndexWithinParent()+f,p=a.getParentOrThrow(),v=[wr(),...c];p.splice(g,0,v);const m=c[c.length-1];m?m.select():o.offset===0?d.selectPrevious():d.getNextSibling().selectNext(0,0)}if($S(a)){const{offset:u}=e.anchor;a.splice(u,0,[wr()]),a.select(u+1,u+1)}return null}canIndent(){return!1}collapseAtStart(){const e=xt();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}setLanguage(e){const t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){const t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){const t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}}function hi(n,e){return g2(ms).setLanguage(n).setTheme(e)}function $S(n){return n instanceof ms}function Qf(n){return{node:hi(n.getAttribute(Po))}}function ek(n){const e=n,t=eg(e);return t||(function(r){let i=r.parentElement;for(;i!==null;){if(eg(i))return!0;i=i.parentElement}return!1})(e)?{node:t?hi():null}:{node:null}}function tk(){return{node:hi()}}function $f(){return{node:null}}function eg(n){return n.style.fontFamily.match("monospace")!==null}function Ol(n){return n.classList.contains("js-file-line-container")}class _s extends Mn{__highlightType;constructor(e="",t,r){super(e,r),this.__highlightType=t}static getType(){return"code-highlight"}static clone(e){return new _s(e.__text,e.__highlightType||void 0,e.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){const t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){const t=super.createDOM(e),r=Ml(e.theme,this.__highlightType);return ar(t,r),t}updateDOM(e,t,r){const i=super.updateDOM(e,t,r),o=Ml(r.theme,e.__highlightType),s=Ml(r.theme,this.__highlightType);return o!==s&&(o&&Fc(t,o),s&&ar(t,s)),i}static importJSON(e){return Fp().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return hi()}}function Ml(n,e){return e&&n&&n.codeHighlight&&n.codeHighlight[e]}function Fp(n="",e){return dn(new _s(n,e))}function Ip(n){return n instanceof _s}function nk(n,e){let t=n;for(let r=Yt(n,e);r&&(Ip(r.origin)||Ba(r.origin));r=F2(r))t=r.origin;return t}function rk(n){return nk(n,"previous")}(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var e={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(e).forEach(function(t){var r=e[t],i=[];/^\w+$/.test(t)||i.push(/\w+/.exec(t)[0]),t==="diff"&&i.push("bold"),n.languages.diff[t]={pattern:RegExp("^(?:["+r+`].*(?:\r
|
|
30
|
-
?|
|
|
31
|
-
|(?![\\s\\S])))+`,"m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(t)[0]}}}}),Object.defineProperty(n.languages.diff,"PREFIXES",{value:e})})(Prism);class Lp extends xi{__format;constructor(e,t){super(t),this.__format=e||""}exportJSON(){return{...super.exportJSON(),format:this.__format||""}}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format||"")}canIndent(){return!1}createDOM(){return document.createElement("div")}updateDOM(){return!1}setFormat(e){const t=this.getWritable();return t.__format=e,t}isInline(){return!1}}function tg(n){return n instanceof Lp}const ik=new Set(["http:","https:","mailto:","sms:","tel:"]);class Kr extends bn{__url;__target;__rel;__title;static getType(){return"link"}static clone(e){return new Kr(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e="",t={},r){super(r);const{target:i=null,rel:o=null,title:s=null}=t;this.__url=e,this.__target=i,this.__rel=o,this.__title=s}createDOM(e){const t=document.createElement("a");return this.updateLinkDOM(null,t,e),ar(t,e.theme.link),t}updateLinkDOM(e,t,r){if(Yv(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(const i of["target","rel","title"]){const o=`__${i}`,s=this[o];e&&e[o]===s||(s?t[i]=s:t.removeAttribute(i))}}}updateDOM(e,t,r){return this.updateLinkDOM(e,t,r),!1}static importDOM(){return{a:e=>({conversion:ok,priority:1})}}static importJSON(e){return Zi().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){e=og(e);try{const t=new URL(og(e));if(!ik.has(t.protocol))return"about:blank"}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){const t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){const t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){const t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){const t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){const r=Zi(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,t),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,r){if(!ae(t))return!1;const i=t.anchor.getNode(),o=t.focus.getNode();return this.isParentOf(i)&&this.isParentOf(o)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function ok(n){let e=null;if(Yv(n)){const t=n.textContent;(t!==null&&t!==""||n.children.length>0)&&(e=Zi(n.getAttribute("href")||"",{rel:n.getAttribute("rel"),target:n.getAttribute("target"),title:n.getAttribute("title")}))}return{node:e}}function Zi(n="",e){return dn(new Kr(n,e))}function Vr(n){return n instanceof Kr}class bs extends Kr{__isUnlinked;constructor(e="",t={},r){super(e,t,r),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}static getType(){return"autolink"}static clone(e){return new bs(e.__url,{isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title},e.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){const t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement("span"):super.createDOM(e)}updateDOM(e,t,r){return super.updateDOM(e,t,r)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return ng().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){const r=this.getParentOrThrow().insertNewAfter(e,t);if(oe(r)){const i=ng(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return r.append(i),i}return null}}function ng(n="",e){return dn(new bs(n,e))}function zs(n){return n instanceof bs}const rg=Ae("TOGGLE_LINK_COMMAND");function ig(n,e){if(n.type==="element"){const t=n.getNode();return oe(t)||(function(r,...i){const o=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",r);for(const a of i)s.append("v",a);throw o.search=s.toString(),Error(`Minified Lexical error #${r}; visit ${o.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(252),t.getChildren()[n.offset+e]||null}return null}function Pl(n,e={}){let t;if(n&&typeof n=="object"){const{url:d,...f}=n;t=d,e={...f,...e}}else t=n;const{target:r,title:i}=e,o=e.rel===void 0?"noreferrer":e.rel,s=fe();if(s===null||!ae(s)&&!kt(s))return;if(kt(s)){const d=s.getNodes();return d.length===0?void 0:void d.forEach(f=>{if(t===null){const g=on(f,p=>!zs(p)&&Vr(p));g&&(g.insertBefore(f),g.getChildren().length===0&&g.remove())}else{const g=on(f,p=>!zs(p)&&Vr(p));if(g)g.setURL(t),r!==void 0&&g.setTarget(r),o!==void 0&&g.setRel(o);else{const p=Zi(t,{rel:o,target:r});f.insertBefore(p),p.append(f)}}})}const a=s.extract();if(t===null){const d=new Set;return void a.forEach(f=>{const g=on(f,p=>!zs(p)&&Vr(p));if(g!==null){const p=g.getKey();if(d.has(p))return;(function(v,m){const h=new Set(m.filter(O=>v.isParentOf(O)).map(O=>O.getKey())),x=v.getChildren(),_=O=>h.has(O.getKey())||oe(O)&&m.some(E=>v.isParentOf(E)&&O.isParentOf(E)),S=x.filter(_);if(S.length===x.length)return x.forEach(O=>v.insertBefore(O)),void v.remove();const k=x.findIndex(_),b=x.findLastIndex(_),C=k===0,T=b===x.length-1;if(C)S.forEach(O=>v.insertBefore(O));else if(T)for(let O=S.length-1;O>=0;O--)v.insertAfter(S[O]);else{for(let E=S.length-1;E>=0;E--)v.insertAfter(S[E]);const O=x.slice(b+1);if(O.length>0){const E=Zi(v.getURL(),{rel:v.getRel(),target:v.getTarget(),title:v.getTitle()});S[S.length-1].insertAfter(E),O.forEach(D=>E.append(D))}}})(g,a),d.add(p)}})}const u=new Set,c=d=>{u.has(d.getKey())||(u.add(d.getKey()),d.setURL(t),r!==void 0&&d.setTarget(r),o!==void 0&&d.setRel(o),i!==void 0&&d.setTitle(i))};if(a.length===1){const d=a[0],f=on(d,Vr);if(f!==null)return c(f)}(function(d){const f=fe();if(!ae(f))return d();const g=ro(f),p=g.isBackward(),v=ig(g.anchor,p?-1:0),m=ig(g.focus,p?0:-1);if(d(),v||m){const h=fe();if(ae(h)){const x=h.clone();if(v){const _=v.getParent();_&&x.anchor.set(_.getKey(),v.getIndexWithinParent()+(p?1:0),"element")}if(m){const _=m.getParent();_&&x.focus.set(_.getKey(),m.getIndexWithinParent()+(p?0:1),"element")}Qt(ro(x))}}})(()=>{let d=null;for(const f of a){if(!f.isAttached())continue;const g=on(f,Vr);if(g){c(g);continue}if(oe(f)){if(!f.isInline())continue;if(Vr(f)){if(!(zs(f)||d!==null&&d.getParentOrThrow().isParentOf(f))){c(f),d=f;continue}for(const v of f.getChildren())f.insertBefore(v);f.remove();continue}}const p=f.getPreviousSibling();Vr(p)&&p.is(d)?p.append(f):(d=Zi(t,{rel:o,target:r,title:i}),f.insertAfter(d),d.append(f))}})}const sk=/^\+?[0-9\s()-]{5,}$/;function og(n){return n.match(/^[a-z][a-z0-9+.-]*:/i)||n.match(/^[/#.]/)?n:n.includes("@")?`mailto:${n}`:sk.test(n)?`tel:${n}`:`https://${n}`}var ak=M("<div><!></div>");function lk(n,e){ce(e,!0);const t=()=>ji(s,"$isSelected",r),[r,i]=Ca(),o=fn();let s=Mp(o,e.nodeKey),a;nt(()=>lr(o.registerCommand(fv,d=>{if(t()){const f=fe();if(kt(f)){const g=yt(e.nodeKey);tg(g)&&g.setFormat(d)}else if(ae(f)){const g=f.getNodes();for(const p of g)tg(p)?p.setFormat(d):dp(p).setFormat(d)}return!0}return!1},rn),o.registerCommand(Fa,d=>d.target===a?(d.preventDefault(),d.shiftKey||Op(o),Wi(s,!t()),!0):!1,rn)));var u=ak(),c=w(u);Dt(c,()=>e.children),_n(u,d=>a=d,()=>a),G(d=>{be(u,1,d),Qn(u,`text-align: ${e.format?e.format:""};`)},[()=>_t([e.className.base,t()?e.className.focus:null].filter(Boolean).join(" "))]),y(n,u),de(),i()}var uk=M('<iframe width="560" height="315" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" title="YouTube video"></iframe>');function ck(n,e){lk(n,{get className(){return e.className},get format(){return e.format},get nodeKey(){return e.nodeKey},children:(t,r)=>{var i=uk();i.allowFullscreen=!0,G(()=>re(i,"src",`https://www.youtube-nocookie.com/embed/${e.videoID}`)),y(t,i)},$$slots:{default:!0}})}function dk(n){const e=n.getAttribute("data-lexical-youtube");return e?{node:jc(e)}:null}class Xa extends Lp{__id;static getType(){return"youtube"}static clone(e){return new Xa(e.__id,e.__format,e.__key)}static importJSON(e){return jc(e.videoID).updateFromJSON(e)}exportJSON(){return{...super.exportJSON(),videoID:this.__id}}constructor(e,t,r){super(t,r),this.__id=e}exportDOM(){const e=document.createElement("iframe");return e.setAttribute("data-lexical-youtube",this.__id),e.setAttribute("width","560"),e.setAttribute("height","315"),e.setAttribute("src",`https://www.youtube-nocookie.com/embed/${this.__id}`),e.setAttribute("frameborder","0"),e.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"),e.setAttribute("allowfullscreen","true"),e.setAttribute("title","YouTube video"),{element:e}}static importDOM(){return{iframe:e=>e.hasAttribute("data-lexical-youtube")?{conversion:dk,priority:1}:null}}updateDOM(){return!1}getId(){return this.__id}getTextContent(e,t){return`https://www.youtube.com/watch?v=${this.__id}`}decorate(e,t){const r=t.theme.embedBlock||{},i={base:r.base||"",focus:r.focus||""};return{componentClass:ck,updateProps:o=>{o.className=i,o.format=this.__format,o.nodeKey=this.__key,o.videoID=this.__id}}}}function jc(n){return new Xa(n)}const Rp=n=>{n.update(()=>{const e=fe();ae(e)&&Ja(e,()=>xt())})},Dl=(n,e,t)=>{e!==t&&n.update(()=>{const r=fe();Ja(r,()=>Bi(t))})},fk=(n,e)=>{e!=="bullet"?n.dispatchCommand(Np,void 0):Rp(n)},gk=(n,e)=>{e!=="number"?n.dispatchCommand(Ap,void 0):Rp(n)},hk=(n,e)=>{e!=="quote"&&n.update(()=>{const t=fe();Ja(t,()=>zc())})},vk=(n,e)=>{e!=="code"&&n.update(()=>{let t=fe();if(t)if(!ae(t)||t.isCollapsed())Ja(t,()=>hi());else{const r=t.getTextContent(),i=hi();t.insertNodes([i]),t=fe(),ae(t)&&t.insertRawText(r)}})};function pk(n){n.dispatchCommand(wn,"bold")}function mk(n){n.dispatchCommand(wn,"italic")}function _k(n){n.dispatchCommand(wn,"strikethrough")}function bk(n){n.dispatchCommand(wn,"underline")}function yk(n){n.dispatchCommand(La,void 0)}function xk(n){n.dispatchCommand(Ra,void 0)}function wk(n,e=void 0){n.focus(()=>{const t=document.activeElement,r=n.getRootElement();r!==null&&(t===null||!r.contains(t))&&r.focus({preventScroll:!0})},{defaultSelection:e})}function zp(n,e){ce(e,!1);const t=fn();ht(()=>{wk(t)}),os(),de()}const sg=new Set,ag=Ae("RIGHT_CLICK_IMAGE_COMMAND");var Sk=M('<img draggable="false"/>'),kk=M('<img src="/images/image-broken.svg" alt="broken link" style="height: 200px; width: 200px; opacity: 0.2;" draggable="false"/>'),Ck=M("<p>...loading image</p>"),Ek=M("<!> <!> <!> <!> <!>",1),Tk=M('<div class="image-caption-container"><!></div>'),Nk=M("<div><!></div> <!> <!>",1);function Ak(n,e){ce(e,!0);const t=()=>ji(d,"$isSelected",o),r=()=>ji(p,"$isEditable",o),i=()=>ji(c,"$buttonRef",o),[o,s]=Ca();let a=X(null),u=X(null),c=Ru(null),d=Mp(e.editor,e.nodeKey),f=X(!1),g,p=oS(),v=U(()=>t()&&kt(l(a))&&!l(f)),m=U(()=>(t()||l(f))&&r()),h=new Promise((B,z)=>{if(sg.has(e.src))B(null);else{const F=new Image;F.src=e.src,F.onload=()=>{sg.add(e.src),B(null)},F.onerror=()=>{z(null)}}});const x=B=>{const z=fe(),F=i();if(t()&&kt(z)&&z.getNodes().length===1){if(e.showCaption)return A(a,null),B.preventDefault(),e.caption.focus(),!0;if(F!==null&&F!==document.activeElement)return B.preventDefault(),F.focus(),!0}return!1},_=B=>g===e.caption||i()===B.target?(A(a,null),e.editor.update(()=>{Wi(d,!0);const z=e.editor.getRootElement();z!==null&&z.focus()}),!0):!1,S=B=>{const z=B;return l(f)?!0:z.target===l(u)?(z.shiftKey?Wi(d,!t()):(Op(e.editor),Wi(d,!0)),!0):!1},k=B=>{e.editor.getEditorState().read(()=>{const z=fe();B.target.tagName==="IMG"&&ae(z)&&z.getNodes().length===1&&e.editor.dispatchCommand(ag,B)})};ht(()=>{const B=e.editor.getRootElement(),z=lr(e.editor.registerUpdateListener(({editorState:F})=>{const I=F.read(()=>fe());kt(I)?A(a,I,!0):A(a,null)}),e.editor.registerCommand(Da,(F,I)=>(g=I,!1),rn),e.editor.registerCommand(Fa,S,rn),e.editor.registerCommand(ag,S,rn),e.editor.registerCommand(ac,F=>F.target===l(u)?(F.preventDefault(),!0):!1,rn),e.editor.registerCommand(Xo,x,rn),e.editor.registerCommand(sc,_,rn));return B?.addEventListener("contextmenu",k),()=>{z(),B?.removeEventListener("contextmenu",k)}});const b=()=>{e.editor.update(()=>{const B=yt(e.nodeKey);lg(B)&&B.setShowCaption(!0)})},C=(B,z)=>{setTimeout(()=>{A(f,!1)},200),e.editor.update(()=>{const F=yt(e.nodeKey);lg(F)&&F.setWidthAndHeight(B,z)})},T=()=>{A(f,!0)},O=uS();let E=X(null);function D(B){return B.toLowerCase().endsWith(".svg")}const L=D(e.src);nt(()=>{if(l(u)&&L){const{naturalWidth:B,naturalHeight:z}=l(u);A(E,{height:z,width:B},!0)}});function V(){if(!L)return{height:e.height,maxWidth:e.maxWidth,width:e.width};const B=l(E)?.width||200,z=l(E)?.height||200;let F=B,I=z;if(F>e.maxWidth){const ie=e.maxWidth/F;F=e.maxWidth,I=Math.round(I*ie)}const Y=500;if(I>Y){const ie=Y/I;I=Y,F=Math.round(F*ie)}return{height:I,maxWidth:e.maxWidth,width:F}}const J=U(V);var R=Nk(),P=q(R),K=w(P);T_(K,()=>h,B=>{var z=Ck();y(B,z)},(B,z)=>{var F=Sk();let I;_n(F,Y=>A(u,Y),()=>l(u)),G(Y=>{re(F,"src",e.src),re(F,"alt",e.altText),Qn(F,`height:${l(J).height==="inherit"?"inherit":l(J).height+"px"};max-width:${e.maxWidth??""}px;width:${l(J).width==="inherit"?"inherit":l(J).width+"px"};`),I=be(F,1,"",null,I,Y)},[()=>({focused:l(m),draggable:l(m)&&kt(l(a))})]),Bn("load",F,Y=>{if(L){const ie=Y.currentTarget;A(E,{height:ie.naturalHeight,width:ie.naturalWidth},!0)}}),y(B,F)},(B,z)=>{var F=kk();y(B,F)});var Q=N(P,2);{var ee=B=>{var z=Tk(),F=w(z);BS(F,{get initialEditor(){return e.caption},get parentEditor(){return e.editor},children:(I,Y)=>{var ie=Ek(),ue=q(ie);zp(ue,{});var we=N(ue,2);Vt(we,()=>O.componentType,(Ne,Oe)=>{Oe(Ne,xe(()=>O.props))});var me=N(we,2);Sp(me,{});var ge=N(me,2);Pp(ge,{className:"ImageNode__contentEditable"});var Te=N(ge,2);JS(Te,{className:"ImageNode__placeholder",children:(Ne,Oe)=>{var he=xr("Enter image caption...");y(Ne,he)},$$slots:{default:!0}}),y(I,ie)},$$slots:{default:!0}}),y(B,z)};W(Q,B=>{e.showCaption&&B(ee)})}var H=N(Q,2);{var j=B=>{zS(B,{get showCaption(){return e.showCaption},setShowCaption:b,get editor(){return e.editor},get buttonRef(){return c},get imageRef(){return l(u)},get maxWidth(){return e.maxWidth},onResizeStart:T,onResizeEnd:C,get captionsEnabled(){return e.captionsEnabled}})},ne=U(()=>e.resizable&&kt(l(a))&&l(m));W(H,B=>{l(ne)&&B(j)})}G(()=>re(P,"draggable",l(v))),y(n,R),de(),s()}class Qa extends Mn{static getType(){return"hashtag"}static clone(e){return new Qa(e.__text,e.__key)}createDOM(e){const t=super.createDOM(e);return ar(t,e.theme.hashtag),t}static importJSON(e){return Ok().updateFromJSON(e)}canInsertTextBefore(){return!1}isTextEntity(){return!0}}function Ok(n=""){return dn(new Qa(n))}class $a extends Mn{static getType(){return"keyword"}static clone(e){return new $a(e.__text,e.__key)}static importJSON(e){return Mk().updateFromJSON(e)}createDOM(e){const t=super.createDOM(e);return t.style.cursor="default",t.className="keyword",t}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}isTextEntity(){return!0}}function Mk(n=""){return dn(new $a(n))}function Pk(n){return n.parentElement!=null&&n.parentElement.tagName==="LI"&&n.previousSibling===null&&n.getAttribute("aria-roledescription")==="checkbox"}function Dk(n){const e=n;if(e.src.startsWith("file:///")||Pk(e))return null;const{alt:t,src:r,width:i,height:o}=e;return{node:xa({altText:t,height:o,src:r,width:i})}}class ys extends xi{__src;__altText;__width;__height;__maxWidth;__showCaption;__caption;__captionsEnabled;static getType(){return"image"}static clone(e){return new ys(e.__src,e.__altText,e.__maxWidth,e.__width,e.__height,e.__showCaption,e.__caption,e.__captionsEnabled,e.__key)}static importJSON(e){const{altText:t,height:r,width:i,maxWidth:o,src:s,showCaption:a}=e;return xa({altText:t,height:r,maxWidth:o,showCaption:a,src:s,width:i}).updateFromJSON(e)}updateFromJSON(e){const t=super.updateFromJSON(e),{caption:r}=e,i=t.__caption,o=i.parseEditorState(r.editorState);return o.isEmpty()||i.setEditorState(o),t}exportDOM(){const e=document.createElement("img");return e.setAttribute("src",this.__src),e.setAttribute("alt",this.__altText),e.setAttribute("width",this.__width.toString()),e.setAttribute("height",this.__height.toString()),{element:e}}static importDOM(){return{img:e=>({conversion:Dk,priority:0})}}constructor(e,t,r,i,o,s,a,u,c){super(c),this.__src=e,this.__altText=t,this.__maxWidth=r,this.__width=i||"inherit",this.__height=o||"inherit",this.__showCaption=s||!1,this.__caption=a||mc({namespace:"Playground/ImageNodeCaption",nodes:[wi,Mn,bi,Si,Kr,Qa,$a]}),this.__captionsEnabled=u||u===void 0}exportJSON(){return{...super.exportJSON(),altText:this.getAltText(),caption:this.__caption.toJSON(),height:this.__height==="inherit"?0:this.__height,maxWidth:this.__maxWidth,showCaption:this.__showCaption,src:this.getSrc(),width:this.__width==="inherit"?0:this.__width}}setWidthAndHeight(e,t){const r=this.getWritable();r.__width=e,r.__height=t}setShowCaption(e){const t=this.getWritable();t.__showCaption=e}createDOM(e){const t=document.createElement("span"),i=e.theme.image;return i!==void 0&&(t.className=i),t}updateDOM(){return!1}getSrc(){return this.__src}getAltText(){return this.__altText}decorate(e,t){return{componentClass:Ak,updateProps:r=>{r.src=this.__src,r.altText=this.__altText,r.width=this.__width,r.height=this.__height,r.maxWidth=this.__maxWidth,r.nodeKey=this.__key,r.showCaption=this.__showCaption,r.caption=this.__caption,r.captionsEnabled=this.__captionsEnabled,r.resizable=!0,r.editor=e}}}}function xa({altText:n,height:e,maxWidth:t=500,captionsEnabled:r,src:i,width:o,showCaption:s,caption:a,key:u}){return dn(new ys(i,n,t,o,e,s,a,r,u))}function lg(n){return n instanceof ys}const ug=[["Cat","rgb(125, 50, 0)"],["Dog","rgb(100, 0, 0)"],["Rabbit","rgb(150, 0, 0)"],["Frog","rgb(200, 0, 0)"],["Fox","rgb(200, 75, 0)"],["Hedgehog","rgb(0, 75, 0)"],["Pigeon","rgb(0, 125, 0)"],["Squirrel","rgb(75, 100, 0)"],["Bear","rgb(125, 100, 0)"],["Tiger","rgb(0, 0, 150)"],["Leopard","rgb(0, 0, 200)"],["Zebra","rgb(0, 0, 250)"],["Wolf","rgb(0, 100, 150)"],["Owl","rgb(0, 100, 100)"],["Gull","rgb(100, 0, 100)"],["Squid","rgb(150, 0, 150)"]],cg=ug[Math.floor(Math.random()*ug.length)];cg[1],cg[0];function Fk(n,e){ce(e,!0);let t=se(e,"validateUrl",19,()=>{}),r=se(e,"attributes",19,()=>({}));const i=fn();ht(()=>{if(!i.hasNodes([Kr]))throw new Error("LinkPlugin: LinkNode not registered on editor");return lr(i.registerCommand(rg,o=>{if(o===null)return Pl(o),!0;if(typeof o=="string")return t()===void 0||t()(o)?(Pl(o,r()),!0):!1;{const{url:s,target:a,rel:u,title:c}=o;return Pl(s,{...r(),rel:u,target:a,title:c}),!0}},rn),t()!==void 0?i.registerCommand(Ia,o=>{const s=fe();if(!ae(s)||s.isCollapsed()||!Ar(o,ClipboardEvent)||o.clipboardData===null)return!1;const a=o.clipboardData.getData("text");return t()(a)?s.getNodes().some(u=>oe(u))?!1:(i.dispatchCommand(rg,a),o.preventDefault(),!0):!1},rn):()=>{})}),de()}ve(["keydown","mousedown","click"]);ve(["click"]);ve(["click"]);ve(["keydown"]);ve(["click"]);ve(["click"]);ve(["click"]);ve(["click"]);ve(["mousedown"]);ve(["change"]);ve(["click"]);ve(["click"]);ve(["click"]);ve(["click"]);ve(["pointerdown"]);function Ik(n,e){ce(e,!0);let t=se(e,"ignoreHistoryMergeTagChange",3,!0),r=se(e,"ignoreSelectionChange",3,!1);const i=fn();ht(()=>{e.onChange&&i.registerUpdateListener(({editorState:o,dirtyElements:s,dirtyLeaves:a,prevEditorState:u,tags:c})=>{r()&&s.size===0&&a.size===0||t()&&c.has(ti)||u.isEmpty()||e.onChange(o,i,c)})}),de()}ve(["click"]);ve(["click"]);ve(["click"]);ve(["click"]);ve(["click"]);ve(["click"]);ve(["click"]);ve(["click"]);ve(["click"]);ve(["click","keydown"]);ve(["click"]);ve(["change"]);ve(["click"]);ve(["click"]);ve(["change"]);ve(["click"]);ve(["click"]);ve(["click"]);ve(["click"]);ve(["click"]);ve(["click"]);ve(["click"]);ve(["click","change"]);const Bs={tag:ti};function Lk(n,e){if(e!==null){if(e===void 0)n.update(()=>{const t=Mt();if(t.isEmpty()){const r=xt();t.append(r);const i=up?document.activeElement:null;(fe()!==null||i!==null&&i===n.getRootElement())&&r.select()}},Bs);else if(e!==null)switch(typeof e){case"string":{const t=n.parseEditorState(e);n.setEditorState(t,Bs);break}case"object":{n.setEditorState(e,Bs);break}case"function":{n.update(()=>{Mt().isEmpty()&&e(n)},Bs);break}}}}function Rk(n){n.extensions={}}function zk(n,e){ce(e,!0);const t=()=>ji(p,"$isEditable",r),[r,i]=Ca(),{theme:o,namespace:s,nodes:a,onError:u,editorState:c,editable:d,html:f}=e.initialConfig,g=mc({editable:d,html:f,namespace:s,nodes:a,onError:S=>u(S,g),theme:o});Lk(g,c),Rk(g),iS(g);const p=Ru(d!==void 0?d:!0);pi("isEditable",p),ht(()=>(g.setEditable(t()),g.registerEditableListener(S=>{Wi(p,S)}))),sS(Bc()),aS();function v(){return g}var m={getEditor:v},h=te(),x=q(h);Dt(x,()=>e.children??Ot),y(n,h);var _=de(m);return i(),_}var Bk=M('<div class="border rounded p-2 bg-background min-h-[60px]"></div>'),Uk=M('<textarea class="w-full min-h-[80px] font-mono text-sm bg-muted/30 rounded p-2 border-none resize-y focus:outline-none focus:ring-1 focus:ring-primary" placeholder="Enter HTML code..." spellcheck="false"></textarea>'),jk=M('<div class="border border-dashed border-muted-foreground/50 rounded p-3 my-2"><div class="flex items-center justify-between mb-2"><span class="text-xs font-medium text-muted-foreground uppercase tracking-wider">Custom HTML</span> <button type="button" class="text-xs px-2 py-0.5 rounded bg-muted hover:bg-accent"> </button></div> <!></div>');function Wk(n,e){ce(e,!0);let t=se(e,"html",3,""),r=se(e,"nodeKey",3,""),i=X(!1),o=X(Be(t()));const s=fn();function a(){s.update(()=>{const h=yt(r());Hk(h)&&h.setHtml(l(o))})}function u(){a()}var c=jk(),d=w(c),f=N(w(d),2),g=w(f),p=N(d,2);{var v=h=>{var x=Bk();Gl(x,t,!0),y(h,x)},m=h=>{var x=Uk();Z("input",x,u),zt(x,()=>l(o),_=>A(o,_)),y(h,x)};W(p,h=>{l(i)?h(v):h(m,-1)})}G(()=>$(g,l(i)?"Edit":"Preview")),Z("click",f,()=>A(i,!l(i))),y(n,c),de()}ve(["click","input"]);class uo extends xi{__html;static getType(){return"custom-html"}static clone(e){return new uo(e.__html,e.__key)}constructor(e,t){super(t),this.__html=e}createDOM(e){const t=document.createElement("div");return t.className="lexical-custom-html",t.setAttribute("contenteditable","false"),t}updateDOM(){return!1}static importJSON(e){return new uo(e.html)}exportJSON(){return{...super.exportJSON(),type:"custom-html",version:1,html:this.__html}}decorate(e,t){return{componentClass:Wk,updateProps:r=>{r.html=this.__html,r.nodeKey=this.__key}}}isInline(){return!1}getHtml(){return this.__html}setHtml(e){const t=this.getWritable();return t.__html=e,t}}function Kk(n){return new uo(n)}function Hk(n){return n instanceof uo}var Vk=M('<textarea class="w-full bg-transparent italic text-lg resize-none focus:outline-none border-none p-0" rows="2" placeholder="Enter quote text..."></textarea> <input class="w-full bg-transparent text-sm text-muted-foreground mt-2 focus:outline-none border-none p-0" placeholder="Attribution (optional)"/>',1),Jk=M('<cite class="block mt-2 text-sm text-muted-foreground not-italic"> </cite>'),qk=M('<blockquote class="italic text-lg"> </blockquote> <!>',1),Gk=M('<div class="border-l-4 border-primary pl-4 py-2 my-2 bg-muted/20 rounded-r cursor-pointer"><!></div>');function Yk(n,e){ce(e,!0);let t=se(e,"text",3,""),r=se(e,"attribution",3,""),i=se(e,"nodeKey",3,""),o=X(!1),s=X(Be(t())),a=X(Be(r()));const u=fn();function c(){A(s,t()),A(a,r()),A(o,!0)}function d(){A(o,!1),u.update(()=>{const h=yt(i());Xk(h)&&(h.setText(l(s)),h.setAttribution(l(a)))})}function f(h){h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),d()),h.key==="Escape"&&A(o,!1)}var g=Gk(),p=w(g);{var v=h=>{var x=Vk(),_=q(x),S=N(_,2);Bn("blur",_,d),Z("keydown",_,f),zt(_,()=>l(s),k=>A(s,k)),Bn("blur",S,d),Z("keydown",S,f),zt(S,()=>l(a),k=>A(a,k)),y(h,x)},m=h=>{var x=qk(),_=q(x),S=w(_),k=N(_,2);{var b=C=>{var T=Jk(),O=w(T);G(()=>$(O,`-- ${r()??""}`)),y(C,T)};W(k,C=>{r()&&C(b)})}G(()=>$(S,t()||"Click to add quote text...")),y(h,x)};W(p,h=>{l(o)?h(v):h(m,-1)})}Z("click",g,c),y(n,g),de()}ve(["click","keydown"]);class co extends xi{__text;__attribution;static getType(){return"pull-quote"}static clone(e){return new co(e.__text,e.__attribution,e.__key)}constructor(e,t,r){super(r),this.__text=e,this.__attribution=t}createDOM(e){const t=document.createElement("div");return t.className="lexical-pull-quote",t.setAttribute("contenteditable","false"),t}updateDOM(){return!1}static importJSON(e){return new co(e.text,e.attribution)}exportJSON(){return{...super.exportJSON(),type:"pull-quote",version:1,text:this.__text,attribution:this.__attribution}}decorate(e,t){return{componentClass:Yk,updateProps:r=>{r.text=this.__text,r.attribution=this.__attribution,r.nodeKey=this.__key}}}isInline(){return!1}getText(){return this.__text}getAttribution(){return this.__attribution}setText(e){const t=this.getWritable();return t.__text=e,t}setAttribution(e){const t=this.getWritable();return t.__attribution=e,t}}function Zk(n,e){return new co(n,e)}function Xk(n){return n instanceof co}const Qk=[co,uo];function Bp(n){const e=new FormData;return e.append("file",n),Ch("/upload/media",e)}function Up(n,e,t={}){const r=new FormData;r.append("file",e);for(const[i,o]of Object.entries(t.extra??{}))r.append(i,o);return Ch(`/upload/${encodeURIComponent(n)}`,r)}var $k=M('<button type="button"><!> </button>'),eC=M('<div class="w-48 shrink-0 overflow-y-auto border-r p-2"><button type="button"><!> All Media</button> <!></div>'),tC=M('<div class="flex h-full items-center justify-center"><p class="text-sm text-muted-foreground">Loading...</p></div>'),nC=M('<div class="flex h-full flex-col items-center justify-center gap-2"><p class="text-sm text-muted-foreground">No media found</p> <button type="button" class="inline-flex h-9 items-center gap-2 rounded-md border px-3 text-sm hover:bg-accent"><!> Upload a file</button></div>'),rC=M('<img class="h-full w-full object-cover group-hover:scale-105 transition-transform"/>'),iC=M('<div class="flex h-full w-full items-center justify-center"><!></div>'),oC=M('<button type="button" class="group flex flex-col overflow-hidden rounded-md border hover:border-primary hover:shadow-sm transition-all"><div class="aspect-square w-full overflow-hidden bg-muted"><!></div> <div class="p-2"><p class="truncate text-xs font-medium"> </p> <p class="text-xs text-muted-foreground"> </p></div></button>'),sC=M('<div class="grid grid-cols-2 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4"></div>'),aC=M('<div class="flex items-center justify-between border-t px-4 py-2"><p class="text-xs text-muted-foreground"> </p> <div class="flex items-center gap-2"><button type="button" class="rounded-md border px-3 py-1 text-sm hover:bg-accent disabled:opacity-50">Previous</button> <span class="text-sm"> </span> <button type="button" class="rounded-md border px-3 py-1 text-sm hover:bg-accent disabled:opacity-50">Next</button></div></div>'),lC=M('<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4"><div class="flex h-[85vh] w-full max-w-5xl flex-col rounded-lg border bg-background shadow-xl"><div class="flex items-center justify-between border-b px-4 py-3"><h2 class="text-lg font-semibold">Media Library</h2> <div class="flex items-center gap-2"><button type="button" class="inline-flex h-9 items-center gap-2 rounded-md bg-primary px-3 text-sm text-primary-foreground hover:bg-primary/90 disabled:opacity-50"><!> </button> <button type="button" class="rounded p-1.5 hover:bg-accent"><!></button></div></div> <div class="border-b px-4 py-2"><div class="relative"><!> <input type="text" placeholder="Search media..." class="h-9 w-full rounded-md border bg-background pl-9 pr-3 text-sm focus:outline-none focus:ring-1 focus:ring-primary"/></div></div> <div class="flex flex-1 overflow-hidden"><!> <div class="flex-1 overflow-y-auto p-4"><!></div></div> <!></div></div> <input type="file" class="hidden"/>',1);function jp(n,e){ce(e,!0);let t=se(e,"open",15,!1),r=se(e,"accept",19,()=>["image/*"]),i=X(Be([])),o=X(Be([])),s=X(""),a=X(null),u=X(!1),c=X(!1),d=X(0),f=X(0),g=X(1),p,v;async function m(){A(u,!0);const R={perPage:24,sort:"-createdAt",page:l(g)};l(s)&&(R.search=l(s)),l(a)&&(R.filter=`folder="${l(a)}"`);const P=await Vo("media",R);P.ok&&(A(i,P.data.records,!0),A(d,P.data.totalRecords,!0),A(f,P.data.totalPages,!0)),A(u,!1)}async function h(){const R=await Vo("media_folders",{perPage:100,sort:"name"});R.ok&&A(o,R.data.records,!0)}function x(R){const P={url:R.file?.url||R.url||"",alt:R.alt||"",filename:R.filename||R.file?.filename||"",mimeType:R.mimeType||R.file?.mimeType||"",size:R.size||R.file?.size||0};e.onSelect(P),t(!1)}async function _(R){const P=R.target,K=P.files;if(K?.length){A(c,!0);for(const Q of K)await Bp(Q);A(c,!1),P.value="",await m()}}function S(R){const P=R.target.value;A(s,P,!0),clearTimeout(v),v=setTimeout(()=>{A(g,1),m()},300)}function k(R){A(a,R,!0),A(g,1),m()}function b(){l(g)>1&&(ea(g,-1),m())}function C(){l(g)<l(f)&&(ea(g),m())}function T(){t(!1)}function O(R){R.key==="Escape"&&T()}function E(R){return R?.startsWith("image/")??!1}function D(R){return R.file?.url||R.url||""}nt(()=>{t()&&(A(g,1),A(s,""),A(a,null),m(),h())});var L=te();Bn("keydown",jo,O);var V=q(L);{var J=R=>{var P=lC(),K=q(P),Q=w(K),ee=w(Q),H=N(w(ee),2),j=w(H),ne=w(j);Ho(ne,{class:"h-4 w-4"});var B=N(ne),z=N(j,2),F=w(z);or(F,{class:"h-5 w-5"});var I=N(ee,2),Y=w(I),ie=w(Y);nc(ie,{class:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"});var ue=N(ie,2),we=N(I,2),me=w(we);{var ge=Fe=>{var tt=eC(),ye=w(tt),Ce=w(ye);na(Ce,{class:"h-4 w-4"});var Pe=N(ye,2);Re(Pe,17,()=>l(o),gt,(Le,Ke)=>{var je=$k(),Me=w(je);na(Me,{class:"h-4 w-4"});var wt=N(Me);G(()=>{be(je,1,`flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm ${l(a)===l(Ke).id?"bg-accent font-medium":"hover:bg-accent"}`),$(wt,` ${(l(Ke).name||l(Ke).title||"Untitled")??""}`)}),Z("click",je,()=>k(l(Ke).id)),y(Le,je)}),G(()=>be(ye,1,`flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm ${l(a)===null?"bg-accent font-medium":"hover:bg-accent"}`)),Z("click",ye,()=>k(null)),y(Fe,tt)};W(me,Fe=>{l(o).length>0&&Fe(ge)})}var Te=N(me,2),Ne=w(Te);{var Oe=Fe=>{var tt=tC();y(Fe,tt)},he=Fe=>{var tt=nC(),ye=N(w(tt),2),Ce=w(ye);Ho(Ce,{class:"h-4 w-4"}),Z("click",ye,()=>p.click()),y(Fe,tt)},et=Fe=>{var tt=sC();Re(tt,21,()=>l(i),gt,(ye,Ce)=>{var Pe=oC(),Le=w(Pe),Ke=w(Le);{var je=dt=>{var Ie=rC();G(qe=>{re(Ie,"src",qe),re(Ie,"alt",l(Ce).alt||l(Ce).filename||"")},[()=>D(l(Ce))]),y(dt,Ie)},Me=U(()=>E(l(Ce).mimeType||l(Ce).file?.mimeType||"")),wt=dt=>{var Ie=iC(),qe=w(Ie);ec(qe,{class:"h-10 w-10 text-muted-foreground"}),y(dt,Ie)};W(Ke,dt=>{l(Me)?dt(je):dt(wt,-1)})}var Pt=N(Le,2),Ve=w(Pt),lt=w(Ve),ot=N(Ve,2),Ze=w(ot);G(dt=>{$(lt,l(Ce).title||l(Ce).filename||"Untitled"),$(Ze,dt)},[()=>rc(l(Ce).size||l(Ce).file?.size||0)]),Z("click",Pe,()=>x(l(Ce))),y(ye,Pe)}),y(Fe,tt)};W(Ne,Fe=>{l(u)?Fe(Oe):l(i).length===0?Fe(he,1):Fe(et,-1)})}var Ye=N(we,2);{var Ct=Fe=>{var tt=aC(),ye=w(tt),Ce=w(ye),Pe=N(ye,2),Le=w(Pe),Ke=N(Le,2),je=w(Ke),Me=N(Ke,2);G(()=>{$(Ce,`${l(d)??""} items`),Le.disabled=l(g)<=1,$(je,`Page ${l(g)??""} of ${l(f)??""}`),Me.disabled=l(g)>=l(f)}),Z("click",Le,b),Z("click",Me,C),y(Fe,tt)};W(Ye,Fe=>{l(f)>1&&Fe(Ct)})}var Tt=N(K,2);_n(Tt,Fe=>p=Fe,()=>p),G(Fe=>{j.disabled=l(c),$(B,` ${l(c)?"Uploading...":"Upload New"}`),ir(ue,l(s)),re(Tt,"accept",Fe)},[()=>r().join(",")]),Z("click",K,Fe=>{Fe.target===Fe.currentTarget&&T()}),Z("click",j,()=>p.click()),Z("click",z,T),Z("input",ue,S),Z("change",Tt,_),y(R,P)};W(V,R=>{t()&&R(J)})}y(n,L),de()}ve(["click","input","change"]);var uC=M('<div class="absolute left-0 top-full mt-1 z-50 min-w-[180px] rounded-md border bg-popover p-1 shadow-md"><button type="button" class="flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent"><!> YouTube Video</button> <button type="button" class="flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent"><!> Image</button> <button type="button" class="flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent"><!> Image from URL</button> <button type="button" class="flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent"><!> Pull Quote</button> <button type="button" class="flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent"><!> Custom HTML</button></div>'),cC=M('<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/50"><div class="bg-popover rounded-lg p-4 shadow-lg w-[400px] space-y-3"><h3 class="text-sm font-medium">Insert YouTube Video</h3> <input type="text" class="w-full rounded-md border px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-primary" placeholder="YouTube URL (e.g. https://youtube.com/watch?v=...)"/> <div class="flex justify-end gap-2"><button type="button" class="rounded-md px-3 py-1.5 text-sm hover:bg-accent">Cancel</button> <button type="button" class="rounded-md bg-primary px-3 py-1.5 text-sm text-primary-foreground hover:bg-primary/90">Insert</button></div></div></div>'),dC=M('<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/50"><div class="bg-popover rounded-lg p-4 shadow-lg w-[400px] space-y-3"><h3 class="text-sm font-medium">Insert Image</h3> <input type="text" class="w-full rounded-md border px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-primary" placeholder="Image URL"/> <input type="text" class="w-full rounded-md border px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-primary" placeholder="Alt text (optional)"/> <div class="flex justify-end gap-2"><button type="button" class="rounded-md px-3 py-1.5 text-sm hover:bg-accent">Cancel</button> <button type="button" class="rounded-md bg-primary px-3 py-1.5 text-sm text-primary-foreground hover:bg-primary/90">Insert</button></div></div></div>'),fC=M('<div class="relative"><button type="button" class="rounded p-1.5 hover:bg-accent flex items-center gap-0.5" title="Insert block"><!> <span class="text-xs">Insert</span></button> <!></div> <!> <!> <!>',1);function gC(n,e){ce(e,!0);const t=fn();let r=X(!1),i=X(!1),o=X(!1),s=X(!1),a=X(""),u=X(""),c=X("");function d(){A(r,!l(r))}function f(){A(r,!1)}function g(P){const K=[/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]{11})/,/^([a-zA-Z0-9_-]{11})$/];for(const Q of K){const ee=P.match(Q);if(ee)return ee[1]}return null}function p(){const P=g(l(a));if(!P){alert("Invalid YouTube URL");return}t.update(()=>{const K=jc(P);Ii([K])}),A(a,""),A(i,!1),f()}function v(P){t.update(()=>{const K=xa({src:P.url,altText:P.alt||"",width:void 0,height:void 0,maxWidth:800});Ii([K])}),A(s,!1),f()}function m(){if(!l(u)){alert("Please enter an image URL");return}t.update(()=>{const P=xa({src:l(u),altText:l(c)||"",width:void 0,height:void 0,maxWidth:800});Ii([P])}),A(u,""),A(c,""),A(o,!1),f()}function h(){t.update(()=>{const P=Zk("","");Ii([P]);const K=xt();P.insertAfter(K)}),f()}function x(){t.update(()=>{const P=Kk("");Ii([P]);const K=xt();P.insertAfter(K)}),f()}function _(P){P.key==="Enter"&&(P.preventDefault(),p()),P.key==="Escape"&&A(i,!1)}function S(P){P.key==="Enter"&&(P.preventDefault(),m()),P.key==="Escape"&&A(o,!1)}var k=fC();Bn("click",jo,()=>{l(r)&&f()});var b=q(k),C=w(b),T=w(C);tc(T,{class:"h-4 w-4"});var O=N(C,2);{var E=P=>{var K=uC(),Q=w(K),ee=w(Q);Qy(ee,{class:"h-4 w-4"});var H=N(Q,2),j=w(H);Xl(j,{class:"h-4 w-4"});var ne=N(H,2),B=w(ne);Xl(B,{class:"h-4 w-4"});var z=N(ne,2),F=w(z);Oh(F,{class:"h-4 w-4"});var I=N(z,2),Y=w(I);fy(Y,{class:"h-4 w-4"}),Z("click",K,ie=>ie.stopPropagation()),Z("click",Q,()=>{A(i,!0),A(r,!1)}),Z("click",H,()=>{A(s,!0),A(r,!1)}),Z("click",ne,()=>{A(o,!0),A(r,!1)}),Z("click",z,h),Z("click",I,x),y(P,K)};W(O,P=>{l(r)&&P(E)})}var D=N(b,2);{var L=P=>{var K=cC(),Q=w(K),ee=N(w(Q),2),H=N(ee,2),j=w(H),ne=N(j,2);Z("click",K,()=>A(i,!1)),Z("click",Q,B=>B.stopPropagation()),Z("keydown",ee,_),zt(ee,()=>l(a),B=>A(a,B)),Z("click",j,()=>A(i,!1)),Z("click",ne,p),y(P,K)};W(D,P=>{l(i)&&P(L)})}var V=N(D,2);{var J=P=>{var K=dC(),Q=w(K),ee=N(w(Q),2),H=N(ee,2),j=N(H,2),ne=w(j),B=N(ne,2);Z("click",K,()=>A(o,!1)),Z("click",Q,z=>z.stopPropagation()),Z("keydown",ee,S),zt(ee,()=>l(u),z=>A(u,z)),Z("keydown",H,S),zt(H,()=>l(c),z=>A(c,z)),Z("click",ne,()=>A(o,!1)),Z("click",B,m),y(P,K)};W(V,P=>{l(o)&&P(J)})}var R=N(V,2);jp(R,{accept:["image/jpeg","image/png","image/webp","image/svg+xml"],onSelect:v,get open(){return l(s)},set open(P){A(s,P,!0)}}),Z("click",C,P=>{P.stopPropagation(),d()}),y(n,k),de()}ve(["click","keydown"]);var hC=M('<div class="flex flex-wrap gap-0.5 border-b bg-muted/30 p-1.5"><button type="button" title="Bold"><!></button> <button type="button" title="Italic"><!></button> <button type="button" title="Underline"><!></button> <button type="button" title="Strikethrough"><!></button> <div class="mx-1 w-px bg-border"></div> <button type="button" title="Heading 1"><!></button> <button type="button" title="Heading 2"><!></button> <button type="button" title="Heading 3"><!></button> <div class="mx-1 w-px bg-border"></div> <button type="button" title="Bullet List"><!></button> <button type="button" title="Ordered List"><!></button> <button type="button" title="Blockquote"><!></button> <button type="button" title="Code Block"><!></button> <div class="mx-1 w-px bg-border"></div> <!> <div class="mx-1 w-px bg-border"></div> <button type="button" class="rounded p-1.5 hover:bg-accent" title="Undo"><!></button> <button type="button" class="rounded p-1.5 hover:bg-accent" title="Redo"><!></button></div>');function vC(n,e){ce(e,!0);const t=fn();let r=X(!1),i=X(!1),o=X(!1),s=X(!1),a=X("paragraph");function u(){const B=fe();if(ae(B)){A(r,B.hasFormat("bold"),!0),A(i,B.hasFormat("italic"),!0),A(o,B.hasFormat("underline"),!0),A(s,B.hasFormat("strikethrough"),!0);const z=B.anchor.getNode(),F=z.getKey()==="root"?z:z.getTopLevelElementOrThrow();if(mS(F))A(a,F.getTag(),!0);else if($e(F)){const I=cp(z,Za);A(a,I?I.getListType():F.getListType(),!0)}else A(a,F.getType(),!0)}}ht(()=>{const B=t.registerCommand(Da,()=>(u(),!1),Fv),z=t.registerUpdateListener(({editorState:F})=>{F.read(()=>{u()})});return()=>{B(),z()}});function c(B){return`rounded p-1.5 hover:bg-accent ${B?"bg-accent text-accent-foreground":""}`}var d=hC(),f=w(d),g=w(f);ay(g,{class:"h-4 w-4"});var p=N(f,2),v=w(p);ky(v,{class:"h-4 w-4"});var m=N(p,2),h=w(m);Zy(h,{class:"h-4 w-4"});var x=N(m,2),_=w(x);Hy(_,{class:"h-4 w-4"});var S=N(x,4),k=w(S);yy(k,{class:"h-4 w-4"});var b=N(S,2),C=w(b);wy(C,{class:"h-4 w-4"});var T=N(b,2),O=w(T);xy(O,{class:"h-4 w-4"});var E=N(T,4),D=w(E);Ah(D,{class:"h-4 w-4"});var L=N(E,2),V=w(L);Ey(V,{class:"h-4 w-4"});var J=N(L,2),R=w(J);Oh(R,{class:"h-4 w-4"});var P=N(J,2),K=w(P);gy(K,{class:"h-4 w-4"});var Q=N(P,4);gC(Q,{});var ee=N(Q,4),H=w(ee);Yy(H,{class:"h-4 w-4"});var j=N(ee,2),ne=w(j);Uy(ne,{class:"h-4 w-4"}),G((B,z,F,I,Y,ie,ue,we,me,ge,Te)=>{be(f,1,B),be(p,1,z),be(m,1,F),be(x,1,I),be(S,1,Y),be(b,1,ie),be(T,1,ue),be(E,1,we),be(L,1,me),be(J,1,ge),be(P,1,Te)},[()=>_t(c(l(r))),()=>_t(c(l(i))),()=>_t(c(l(o))),()=>_t(c(l(s))),()=>_t(c(l(a)==="h1")),()=>_t(c(l(a)==="h2")),()=>_t(c(l(a)==="h3")),()=>_t(c(l(a)==="bullet")),()=>_t(c(l(a)==="number")),()=>_t(c(l(a)==="quote")),()=>_t(c(l(a)==="code"))]),Z("click",f,()=>pk(t)),Z("click",p,()=>mk(t)),Z("click",m,()=>bk(t)),Z("click",x,()=>_k(t)),Z("click",S,()=>Dl(t,l(a),"h1")),Z("click",b,()=>Dl(t,l(a),"h2")),Z("click",T,()=>Dl(t,l(a),"h3")),Z("click",E,()=>fk(t,l(a))),Z("click",L,()=>gk(t,l(a))),Z("click",J,()=>hk(t,l(a))),Z("click",P,()=>vk(t,l(a))),Z("click",ee,()=>yk(t)),Z("click",j,()=>xk(t)),y(n,d),de()}ve(["click"]);var pC=M('<span class="text-destructive">*</span>'),mC=M('<!> <div class="relative"><!> <!></div> <!> <!> <!> <!> <!>',1),_C=M('<p class="mt-1 text-xs text-destructive"> </p>'),bC=M('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <div><!></div> <!></div>');function yC(n,e){ce(e,!0);let t=se(e,"value",15);function r(){if(t()){if(typeof t()=="string")try{return JSON.parse(t()),t()}catch{return}if(typeof t()=="object")return JSON.stringify(t())}}const i=r(),o={paragraph:"mb-2",heading:{h1:"text-2xl font-bold mb-3",h2:"text-xl font-bold mb-2",h3:"text-lg font-semibold mb-2"},list:{ul:"list-disc pl-6 mb-2",ol:"list-decimal pl-6 mb-2",listitem:"mb-1",nested:{listitem:"list-none"}},quote:"border-l-4 border-muted-foreground/30 pl-4 italic mb-2",code:"bg-muted rounded px-1 py-0.5 font-mono text-sm block mb-2",link:"text-primary underline",text:{bold:"font-bold",italic:"italic",underline:"underline",strikethrough:"line-through",code:"bg-muted rounded px-1 font-mono text-sm"}},s={namespace:e.field.name,nodes:[vs,Ya,Za,ps,bs,Kr,ms,_s,ys,Xa,...Qk],theme:o,onError:x=>console.error("[Lexical]",x),editorState:i};function a(x,_){const S=x.toJSON();t(JSON.stringify(S))}var u=bC(),c=w(u),d=w(c),f=N(d);{var g=x=>{var _=pC();y(x,_)};W(f,x=>{e.field.required&&x(g)})}var p=N(c,2),v=w(p);zk(v,{get initialConfig(){return s},children:(x,_)=>{var S=mC(),k=q(S);vC(k,{});var b=N(k,2),C=w(b);Sp(C,{});var T=N(C,2);Pp(T,{className:"max-w-none px-4 py-3 min-h-[200px] focus:outline-none"});var O=N(b,2);wS(O,{});var E=N(O,2);FS(E,{});var D=N(E,2);Fk(D,{});var L=N(D,2);zp(L,{});var V=N(L,2);Ik(V,{onChange:a,ignoreHistoryMergeTagChange:!0,ignoreSelectionChange:!0}),y(x,S)},$$slots:{default:!0}});var m=N(p,2);{var h=x=>{var _=_C(),S=w(_);G(()=>$(S,e.error)),y(x,_)};W(m,x=>{e.error&&x(h)})}G(()=>{$(d,`${e.field.label??""} `),be(p,1,`rounded-md border ${e.error?"border-destructive":""}`)}),y(n,u),de()}var xC=M('<span class="text-destructive">*</span>'),wC=M('<span class="inline-flex items-center gap-1 rounded-full border bg-secondary px-2 py-0.5 text-xs"> <button type="button" class="hover:text-destructive"><!></button></span>'),SC=M('<p class="px-3 py-2 text-sm text-muted-foreground">Loading...</p>'),kC=M('<p class="px-3 py-2 text-sm text-muted-foreground">No results</p>'),CC=M('<button type="button" class="flex w-full items-center px-3 py-2 text-left text-sm hover:bg-accent"> </button>'),EC=M('<div class="fixed inset-0 z-40"></div> <div class="absolute z-50 mt-1 max-h-48 w-full overflow-y-auto rounded-md border bg-popover shadow-lg"><!></div>',1),TC=M('<div class="relative"><div><!> <input type="text" class="min-w-[120px] flex-1 bg-transparent px-1 py-0.5 text-sm outline-none"/></div> <!></div>'),NC=M('<div><span> </span> <button type="button" class="text-muted-foreground hover:text-destructive" aria-label="Clear selection"><!></button></div>'),AC=M('<!> <input type="text"/>',1),OC=M('<p class="px-3 py-2 text-sm text-muted-foreground">Loading...</p>'),MC=M('<p class="px-3 py-2 text-sm text-muted-foreground">No results</p>'),PC=M('<button type="button" class="flex w-full items-center px-3 py-2 text-left text-sm hover:bg-accent"> </button>'),DC=M('<div class="fixed inset-0 z-40"></div> <div class="absolute z-50 mt-1 max-h-48 w-full overflow-y-auto rounded-md border bg-popover shadow-lg"><!></div>',1),FC=M('<div class="relative"><!> <!></div>'),IC=M('<p class="mt-1 text-xs text-destructive"> </p>'),LC=M('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <!> <!></div>');function RC(n,e){ce(e,!0);let t=se(e,"value",15),r=X(""),i=X(Be([])),o=X(!1),s=X(!1),a,u=X(null),c=X(Be([])),d=U(()=>e.field.relationType==="manyToMany"),f=U(()=>l(d)?Array.isArray(t())?l(c).length>0?l(c):t():[]:[]);ht(async()=>{if(e.field.relatesTo){if(!l(d)&&t()&&typeof t()=="string"){const P=await ia(e.field.relatesTo,t());P.ok&&A(u,P.data,!0)}else if(l(d)&&Array.isArray(t())&&t().length>0&&t().some(K=>typeof K=="string")){const K=t().map(ee=>typeof ee=="string"?ee:ee.id),Q=await Promise.all(K.map(async ee=>{const H=await ia(e.field.relatesTo,ee);return H.ok?H.data:null}));A(c,Q.filter(ee=>ee!==null),!0)}}});function g(){if(!e.field.relatesTo)return"name";const P=po(en.collections,e.field.relatesTo);if(P?.admin?.useAsTitle)return P.admin.useAsTitle;const K=["name","title","label","slug"];for(const Q of K)if(P?.fields?.some(ee=>ee.name===Q))return Q;return"name"}async function p(P){if(!e.field.relatesTo)return;A(s,!0);const K=g(),Q={perPage:20,fields:`id,${K}`};if(P.trim()){const H=P.trim().replace(/'/g,"''");Q.filter=`${K}~'${H}'`}const ee=await Vo(e.field.relatesTo,Q);A(s,!1),ee.ok&&A(i,ee.data.records,!0)}function v(P){const K=P.target;A(r,K.value,!0),clearTimeout(a),a=setTimeout(()=>p(l(r)),300)}function m(){A(o,!0),p(l(r))}function h(P){return P.name||P.title||P.label||P.slug||P.id||"-"}function x(P){l(d)?(Array.isArray(t())?t():[]).map(Q=>typeof Q=="object"?Q.id:Q).includes(P.id)||(t([...Array.isArray(t())?t():[],P]),A(c,[...l(c),P],!0)):(t(P.id),A(u,P,!0),A(o,!1)),A(r,"")}function _(P){l(d)&&Array.isArray(t())&&(t(t().filter(K=>(typeof K=="object"?K.id:K)!==P)),A(c,l(c).filter(K=>K.id!==P),!0))}function S(){t(l(d)?[]:null)}let k=U(()=>{if(l(d)||!t())return"";if(typeof t()=="object")return h(t());if(l(u))return h(l(u));const P=l(i).find(K=>K.id===t());return P?h(P):t()});var b=LC(),C=w(b),T=w(C),O=N(T);{var E=P=>{var K=xC();y(P,K)};W(O,P=>{e.field.required&&P(E)})}var D=N(C,2);{var L=P=>{var K=TC(),Q=w(K),ee=w(Q);Re(ee,17,()=>l(f),gt,(B,z)=>{const F=U(()=>typeof l(z)=="object"?l(z).id:l(z)),I=U(()=>typeof l(z)=="object"?h(l(z)):l(z));var Y=wC(),ie=w(Y),ue=N(ie),we=w(ue);or(we,{class:"h-3 w-3"}),G(()=>{$(ie,`${l(I)??""} `),re(ue,"aria-label",`Remove ${l(I)??""}`)}),Z("click",ue,()=>_(l(F))),y(B,Y)});var H=N(ee,2),j=N(Q,2);{var ne=B=>{var z=EC(),F=q(z),I=N(F,2),Y=w(I);{var ie=me=>{var ge=SC();y(me,ge)},ue=me=>{var ge=kC();y(me,ge)},we=me=>{var ge=te(),Te=q(ge);Re(Te,17,()=>l(i),gt,(Ne,Oe)=>{var he=CC(),et=w(he);G(Ye=>$(et,Ye),[()=>h(l(Oe))]),Z("click",he,()=>x(l(Oe))),y(Ne,he)}),y(me,ge)};W(Y,me=>{l(s)?me(ie):l(i).length===0?me(ue,1):me(we,-1)})}Z("click",F,()=>A(o,!1)),Z("keydown",F,()=>{}),y(B,z)};W(j,B=>{l(o)&&B(ne)})}G(()=>{be(Q,1,`flex min-h-10 w-full flex-wrap items-center gap-1 rounded-md border bg-background px-2 py-1.5 text-sm focus-within:outline-none focus-within:ring-2 focus-within:ring-ring ${e.error?"border-destructive":""}`),ir(H,l(r)),re(H,"placeholder",l(f).length===0?`Select ${e.field.relatesTo}...`:"Add more...")}),Z("input",H,v),Bn("focus",H,m),y(P,K)},V=P=>{var K=FC(),Q=w(K);{var ee=B=>{var z=NC(),F=w(z),I=w(F),Y=N(F,2),ie=w(Y);or(ie,{class:"h-4 w-4"}),G(()=>{be(z,1,`flex h-10 w-full items-center justify-between rounded-md border bg-background px-3 text-sm ${e.error?"border-destructive":""}`),$(I,l(k))}),Z("click",Y,S),y(B,z)},H=B=>{var z=AC(),F=q(z);nc(F,{class:"absolute left-3 top-2.5 h-4 w-4 text-muted-foreground"});var I=N(F,2);G(()=>{ir(I,l(r)),be(I,1,`h-10 w-full rounded-md border bg-background pl-9 pr-3 text-sm focus:outline-none focus:ring-2 focus:ring-ring ${e.error?"border-destructive":""}`),re(I,"placeholder",`Select ${e.field.relatesTo??""}...`)}),Z("input",I,v),Bn("focus",I,m),y(B,z)};W(Q,B=>{l(k)?B(ee):B(H,-1)})}var j=N(Q,2);{var ne=B=>{var z=DC(),F=q(z),I=N(F,2),Y=w(I);{var ie=me=>{var ge=OC();y(me,ge)},ue=me=>{var ge=MC();y(me,ge)},we=me=>{var ge=te(),Te=q(ge);Re(Te,17,()=>l(i),gt,(Ne,Oe)=>{var he=PC(),et=w(he);G(Ye=>$(et,Ye),[()=>h(l(Oe))]),Z("click",he,()=>x(l(Oe))),y(Ne,he)}),y(me,ge)};W(Y,me=>{l(s)?me(ie):l(i).length===0?me(ue,1):me(we,-1)})}Z("click",F,()=>A(o,!1)),Z("keydown",F,()=>{}),y(B,z)};W(j,B=>{l(o)&&!l(k)&&B(ne)})}y(P,K)};W(D,P=>{l(d)?P(L):P(V,-1)})}var J=N(D,2);{var R=P=>{var K=IC(),Q=w(K);G(()=>$(Q,e.error)),y(P,K)};W(J,P=>{e.error&&P(R)})}G(()=>{re(C,"for",e.field.name),$(T,`${e.field.label??""} `)}),y(n,b),de()}ve(["click","input","keydown"]);var zC=M('<span class="text-destructive">*</span>'),BC=M('<div class="relative"><button type="button" class="group relative h-16 w-16 shrink-0 overflow-hidden rounded"><img class="h-full w-full object-cover"/> <div class="absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 transition-opacity group-hover:opacity-100"><!></div></button></div>'),UC=M('<div class="flex h-16 w-16 shrink-0 items-center justify-center rounded bg-muted text-lg">📄</div>'),jC=M('<div class="flex items-start gap-3 rounded-md border bg-muted/30 p-2"><!> <div class="flex-1 space-y-1"><p class="text-xs font-medium"> </p> <p class="text-xs text-muted-foreground"> </p> <div><label class="mb-0.5 block text-xs font-medium text-muted-foreground">Alt text</label> <input type="text" placeholder="Describe the image" class="h-7 w-full rounded border bg-background px-2 text-xs"/></div></div> <button type="button" class="shrink-0 rounded p-1 text-muted-foreground hover:text-destructive"><!></button></div>'),WC=M('<div class="mb-2 space-y-2"></div>'),KC=M('<p class="mt-1 text-xs text-destructive"> </p>'),HC=M('<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/80 p-4" role="button" tabindex="0"><div class="relative max-h-[90vh] max-w-[90vw]"><button type="button" class="absolute -right-2 -top-2 rounded-full bg-white p-2 text-black shadow-lg hover:bg-gray-100"><!></button> <button type="button" class="appearance-none border-0 bg-transparent p-0 cursor-pointer"><img alt="Preview" class="max-h-[90vh] max-w-[90vw] rounded object-contain"/></button></div></div>'),VC=M('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <!> <button type="button"><!> <!></button> <button type="button" class="inline-flex h-10 items-center gap-2 rounded-md border bg-background px-4 text-sm hover:bg-accent"><!> Browse Media</button> <input type="file" class="hidden"/> <!></div> <!> <!>',1);function JC(n,e){ce(e,!0);let t=se(e,"value",15),r=X(!1),i,o=X(null),s=X(!1),a=U(()=>{if(!t())return[];let j=t();if(typeof j=="string")try{j=JSON.parse(j)}catch{return[]}return e.field.multiple?Array.isArray(j)?j:[]:typeof j=="object"&&j?.url?[j]:[]});function u(j){return j?.startsWith("image/")??!1}async function c(j){const ne=j.target,B=ne.files;if(B?.length){A(r,!0);for(const z of B){const F=await Bp(z);if(F.ok){const I={url:F.data.url,alt:"",filename:F.data.filename,mimeType:F.data.mimeType,size:F.data.size};if(e.field.multiple){const Y=Array.isArray(t())?[...t()]:[];t([...Y,I])}else t(I);ze.success(`Uploaded ${z.name}`);try{await Ql("media",{title:z.name,alt:"",filename:F.data.filename,mimeType:F.data.mimeType,size:F.data.size,file:{url:F.data.url,filename:F.data.filename,mimeType:F.data.mimeType,size:F.data.size}})}catch{}}else ze.error(`Failed to upload ${z.name}: ${F.error}`)}A(r,!1),ne.value=""}}function d(j){e.field.multiple&&Array.isArray(t())?t(t().filter((ne,B)=>B!==j)):t(null)}function f(j,ne){e.field.multiple&&Array.isArray(t())?t(t().map((B,z)=>z===j?{...B,alt:ne}:B)):t()&&t({...t(),alt:ne})}function g(j){A(o,j,!0)}function p(){A(o,null)}function v(j){const ne={url:j.url,alt:j.alt||"",filename:j.filename,mimeType:j.mimeType,size:j.size};if(e.field.multiple){const B=Array.isArray(t())?[...t()]:[];t([...B,ne])}else t(ne)}var m=VC(),h=q(m),x=w(h),_=w(x),S=N(_);{var k=j=>{var ne=zC();y(j,ne)};W(S,j=>{e.field.required&&j(k)})}var b=N(x,2);{var C=j=>{var ne=WC();Re(ne,21,()=>l(a),gt,(B,z,F)=>{var I=jC(),Y=w(I);{var ie=Fe=>{var tt=BC(),ye=w(tt),Ce=w(ye),Pe=N(Ce,2),Le=w(Pe);Nh(Le,{class:"h-5 w-5 text-white"}),G(()=>{re(Ce,"src",l(z).url),re(Ce,"alt",l(z).alt||l(z).filename)}),Z("click",ye,()=>g(l(z).url)),y(Fe,tt)},ue=U(()=>u(l(z).mimeType)&&l(z).url),we=Fe=>{var tt=UC();y(Fe,tt)};W(Y,Fe=>{l(ue)?Fe(ie):Fe(we,-1)})}var me=N(Y,2),ge=w(me),Te=w(ge),Ne=N(ge,2),Oe=w(Ne),he=N(Ne,2),et=w(he);re(et,"for",`alt-${F}`);var Ye=N(et,2);re(Ye,"id",`alt-${F}`);var Ct=N(me,2),Tt=w(Ct);or(Tt,{class:"h-4 w-4"}),G(Fe=>{$(Te,l(z).filename),$(Oe,Fe),ir(Ye,l(z).alt)},[()=>rc(l(z).size)]),Z("input",Ye,Fe=>f(F,Fe.target.value)),Z("click",Ct,()=>d(F)),y(B,I)}),y(j,ne)};W(b,j=>{l(a).length>0&&j(C)})}var T=N(b,2),O=w(T);Ho(O,{class:"h-4 w-4"});var E=N(O,2);{var D=j=>{var ne=xr("Uploading...");y(j,ne)},L=j=>{var ne=xr();G(()=>$(ne,`${l(a).length>0?"Add":"Upload"} File${e.field.multiple?"s":""}`)),y(j,ne)};W(E,j=>{l(r)?j(D):j(L,-1)})}var V=N(T,2),J=w(V);na(J,{class:"h-4 w-4"});var R=N(V,2);_n(R,j=>i=j,()=>i);var P=N(R,2);{var K=j=>{var ne=KC(),B=w(ne);G(()=>$(B,e.error)),y(j,ne)};W(P,j=>{e.error&&j(K)})}var Q=N(h,2);{let j=U(()=>e.field.accept||["image/*"]);jp(Q,{get accept(){return l(j)},onSelect:v,get open(){return l(s)},set open(ne){A(s,ne,!0)}})}var ee=N(Q,2);{var H=j=>{var ne=HC(),B=w(ne),z=w(B),F=w(z);or(F,{class:"h-5 w-5"});var I=N(z,2),Y=w(I);G(()=>re(Y,"src",l(o))),Z("click",ne,p),Z("keydown",ne,ie=>ie.key==="Escape"&&p()),Z("click",z,p),Z("click",I,ie=>ie.stopPropagation()),y(j,ne)};W(ee,j=>{l(o)&&j(H)})}G(j=>{$(_,`${e.field.label??""} `),T.disabled=l(r),be(T,1,`inline-flex h-10 items-center gap-2 rounded-md border bg-background px-4 text-sm hover:bg-accent disabled:opacity-50 ${e.error?"border-destructive":""}`),R.multiple=e.field.multiple||!1,re(R,"accept",j)},[()=>e.field.accept?.join(",")]),Z("click",T,()=>i.click()),Z("click",V,()=>A(s,!0)),Z("change",R,c),y(n,m),de()}ve(["click","input","change","keydown"]);var qC=M('<span class="text-destructive">*</span>'),GC=M('<button type="button" class="group relative h-16 w-16 shrink-0 overflow-hidden rounded"><img class="h-full w-full object-cover"/> <div class="absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 transition-opacity group-hover:opacity-100"><!></div></button>'),YC=M('<div class="flex h-16 w-16 shrink-0 items-center justify-center rounded bg-muted text-lg">📄</div>'),ZC=M('<p class="text-muted-foreground"> </p>'),XC=M('<div class="mb-2 flex items-start gap-3 rounded-md border bg-muted/30 p-2"><!> <div class="flex-1 space-y-1 text-xs"><p class="font-medium"> </p> <!></div> <button type="button" class="shrink-0 rounded p-1 text-muted-foreground hover:text-destructive" aria-label="Clear"><!></button></div>'),QC=M('<button type="button"><!> </button>'),$C=M('<p class="mt-1 text-xs text-destructive"> </p>'),eE=M('<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/80 p-4" role="button" tabindex="0"><img class="max-h-[90vh] max-w-[90vw] rounded object-contain"/></div>'),tE=M('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <!> <input type="file" class="hidden"/> <!></div> <!>',1);function nE(n,e){ce(e,!0);let t=se(e,"value",15),r=X(!1),i=X(null),o,s=X(!1);async function a(){if(!t()){A(i,null);return}if(typeof t()=="object"&&t()&&"url"in t()){A(i,t(),!0);return}if(typeof t()=="string"&&e.field.relatesTo){const L=await ia(e.field.relatesTo,t());L.ok?A(i,L.data,!0):A(i,null)}}ht(()=>{a()}),nt(()=>{a()});function u(L){return!!L&&L.startsWith("image/")}async function c(L){const V=L.target,J=V.files?.[0];if(!J)return;if(!e.field.relatesTo){ze.error("field.Upload missing relatesTo");return}A(r,!0);const R=await Up(e.field.relatesTo,J);A(r,!1),V.value="",R.ok?(t(R.data.id),A(i,R.data,!0),ze.success(`Uploaded ${J.name}`)):ze.error(`Upload failed: ${R.error}`)}function d(){t(null),A(i,null)}function f(){A(s,!0)}function g(){A(s,!1)}var p=tE(),v=q(p),m=w(v),h=w(m),x=N(h);{var _=L=>{var V=qC();y(L,V)};W(x,L=>{e.field.required&&L(_)})}var S=N(m,2);{var k=L=>{var V=XC(),J=w(V);{var R=F=>{var I=GC(),Y=w(I),ie=N(Y,2),ue=w(ie);Nh(ue,{class:"h-5 w-5 text-white"}),G(()=>{re(Y,"src",l(i).url),re(Y,"alt",l(i).alt??l(i).filename)}),Z("click",I,f),y(F,I)},P=U(()=>u(l(i).mimeType)&&l(i).url),K=F=>{var I=YC();y(F,I)};W(J,F=>{l(P)?F(R):F(K,-1)})}var Q=N(J,2),ee=w(Q),H=w(ee),j=N(ee,2);{var ne=F=>{var I=ZC(),Y=w(I);G(ie=>$(Y,ie),[()=>rc(l(i).size)]),y(F,I)};W(j,F=>{typeof l(i).size=="number"&&F(ne)})}var B=N(Q,2),z=w(B);or(z,{class:"h-4 w-4"}),G(()=>$(H,l(i).filename)),Z("click",B,d),y(L,V)},b=L=>{var V=QC(),J=w(V);Ho(J,{class:"h-4 w-4"});var R=N(J);G(()=>{V.disabled=l(r),be(V,1,`inline-flex h-10 items-center gap-2 rounded-md border bg-background px-4 text-sm hover:bg-accent disabled:opacity-50 ${e.error?"border-destructive":""}`),$(R,` ${l(r)?"Uploading…":"Upload File"}`)}),Z("click",V,()=>o.click()),y(L,V)};W(S,L=>{l(i)?L(k):L(b,-1)})}var C=N(S,2);_n(C,L=>o=L,()=>o);var T=N(C,2);{var O=L=>{var V=$C(),J=w(V);G(()=>$(J,e.error)),y(L,V)};W(T,L=>{e.error&&L(O)})}var E=N(v,2);{var D=L=>{var V=eE(),J=w(V);G(()=>{re(J,"src",l(i).url),re(J,"alt",l(i).alt??l(i).filename)}),Z("click",V,g),Z("keydown",V,R=>R.key==="Escape"&&g()),y(L,V)};W(E,L=>{l(s)&&l(i)&&l(i).url&&L(D)})}G(()=>$(h,`${e.field.label??""} `)),Z("change",C,c),y(n,p),de()}ve(["click","change","keydown"]);var rE=M('<span class="text-destructive">*</span>'),iE=M('<img class="h-full w-full object-cover"/>'),oE=M('<div class="flex h-full w-full items-center justify-center bg-muted text-2xl">📄</div>'),sE=M('<div class="group relative aspect-square overflow-hidden rounded border"><!> <div class="absolute inset-x-0 bottom-0 flex justify-between bg-black/60 opacity-0 transition-opacity group-hover:opacity-100"><button type="button" class="p-1 text-white" aria-label="Move up"><!></button> <button type="button" class="p-1 text-white" aria-label="Move down"><!></button> <button type="button" class="p-1 text-white" aria-label="Remove"><!></button></div></div>'),aE=M('<div class="mb-2 grid grid-cols-3 gap-2 sm:grid-cols-4 md:grid-cols-6"></div>'),lE=M('<p class="mt-1 text-xs text-destructive"> </p>'),uE=M('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <!> <button type="button"><!> </button> <input type="file" multiple="" class="hidden"/> <!></div>');function cE(n,e){ce(e,!0);let t=se(e,"value",15),r=X(!1),i=X(Be([])),o;async function s(){const E=Array.isArray(t())?t():[];if(E.length===0||!e.field.relatesTo){A(i,[],!0);return}const D=E.map(R=>typeof R=="object"&&R?R.id:R),L=D.map(R=>`id='${R.replace(/'/g,"''")}'`).join(" || "),V=await Vo(e.field.relatesTo,{filter:L,perPage:D.length});if(!V.ok){A(i,[],!0);return}const J=new Map;for(const R of V.data.records)J.set(R.id,R);A(i,D.map(R=>J.get(R)).filter(R=>R!==void 0),!0)}ht(()=>{s()}),nt(()=>{s()});async function a(E){const D=E.target,L=D.files;if(L?.length){if(!e.field.relatesTo){ze.error("field.Upload missing relatesTo");return}A(r,!0);try{for(const V of L){const J=await Up(e.field.relatesTo,V);J.ok?(t([...Array.isArray(t())?t():[],J.data.id]),A(i,[...l(i),J.data],!0),ze.success(`Uploaded ${V.name}`)):ze.error(`Upload failed for ${V.name}: ${J.error}`)}}finally{A(r,!1),D.value=""}}}function u(E){Array.isArray(t())&&(t(t().filter((D,L)=>L!==E)),A(i,l(i).filter((D,L)=>L!==E),!0))}function c(E){if(!Array.isArray(t())||E===0)return;const D=[...t()];[D[E-1],D[E]]=[D[E],D[E-1]],t(D);const L=[...l(i)];[L[E-1],L[E]]=[L[E],L[E-1]],A(i,L,!0)}function d(E){if(!Array.isArray(t())||E===t().length-1)return;const D=[...t()];[D[E],D[E+1]]=[D[E+1],D[E]],t(D);const L=[...l(i)];[L[E],L[E+1]]=[L[E+1],L[E]],A(i,L,!0)}function f(E){return!!E&&E.startsWith("image/")}var g=uE(),p=w(g),v=w(p),m=N(v);{var h=E=>{var D=rE();y(E,D)};W(m,E=>{e.field.required&&E(h)})}var x=N(p,2);{var _=E=>{var D=aE();Re(D,23,()=>l(i),L=>L.id,(L,V,J)=>{var R=sE(),P=w(R);{var K=Y=>{var ie=iE();G(()=>{re(ie,"src",l(V).url),re(ie,"alt",l(V).alt??l(V).filename)}),y(Y,ie)},Q=U(()=>f(l(V).mimeType)&&l(V).url),ee=Y=>{var ie=oE();y(Y,ie)};W(P,Y=>{l(Q)?Y(K):Y(ee,-1)})}var H=N(P,2),j=w(H),ne=w(j);$u(ne,{class:"h-3 w-3"});var B=N(j,2),z=w(B);ls(z,{class:"h-3 w-3"});var F=N(B,2),I=w(F);or(I,{class:"h-3 w-3"}),Z("click",j,()=>c(l(J))),Z("click",B,()=>d(l(J))),Z("click",F,()=>u(l(J))),y(L,R)}),y(E,D)};W(x,E=>{l(i).length>0&&E(_)})}var S=N(x,2),k=w(S);Ho(k,{class:"h-4 w-4"});var b=N(k),C=N(S,2);_n(C,E=>o=E,()=>o);var T=N(C,2);{var O=E=>{var D=lE(),L=w(D);G(()=>$(L,e.error)),y(E,D)};W(T,E=>{e.error&&E(O)})}G(()=>{$(v,`${e.field.label??""} `),S.disabled=l(r),be(S,1,`inline-flex h-10 items-center gap-2 rounded-md border bg-background px-4 text-sm hover:bg-accent disabled:opacity-50 ${e.error?"border-destructive":""}`),$(b,` ${l(r)?"Uploading…":l(i).length>0?"Add Files":"Upload Files"}`)}),Z("click",S,()=>o.click()),Z("change",C,a),y(n,g),de()}ve(["click","change"]);function dE(n,e){ce(e,!0);let t=se(e,"value",15);var r=te(),i=q(r);{var o=a=>{cE(a,{get field(){return e.field},get error(){return e.error},get value(){return t()},set value(u){t(u)}})},s=a=>{nE(a,{get field(){return e.field},get error(){return e.error},get value(){return t()},set value(u){t(u)}})};W(i,a=>{e.field.relationType==="manyToMany"?a(o):a(s,-1)})}y(n,r),de()}function dg(n){return n.toLowerCase().replace(/[^\w\s-]/g,"").replace(/[\s_]+/g,"-").replace(/^-+|-+$/g,"").trim()}var fE=M('<span class="text-destructive">*</span>'),gE=M('<p class="mt-1 text-xs text-muted-foreground"> </p>'),hE=M('<p class="mt-1 text-xs text-destructive"> </p>'),vE=M('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <div class="flex items-center gap-2"><input type="text"/> <button type="button" class="flex h-10 w-10 items-center justify-center rounded-md border hover:bg-accent"><!></button></div> <!> <!></div>');function pE(n,e){ce(e,!0);let t=se(e,"value",15),r=se(e,"formData",19,()=>({})),i=X(!0);nt(()=>{l(i)&&e.field.fromField&&r()[e.field.fromField]&&t(dg(String(r()[e.field.fromField])))});function o(){A(i,!l(i)),l(i)&&e.field.fromField&&r()[e.field.fromField]&&t(dg(String(r()[e.field.fromField])))}var s=vE(),a=w(s),u=w(a),c=N(u);{var d=b=>{var C=fE();y(b,C)};W(c,b=>{e.field.required&&b(d)})}var f=N(a,2),g=w(f),p=N(g,2),v=w(p);{var m=b=>{Ny(b,{class:"h-4 w-4"})},h=b=>{Ty(b,{class:"h-4 w-4"})};W(v,b=>{l(i)?b(m):b(h,-1)})}var x=N(f,2);{var _=b=>{var C=gE(),T=w(C);G(()=>$(T,l(i)?"Auto-generated from "+e.field.fromField:"Manual editing enabled")),y(b,C)};W(x,b=>{e.field.fromField&&b(_)})}var S=N(x,2);{var k=b=>{var C=hE(),T=w(C);G(()=>$(T,e.error)),y(b,C)};W(S,b=>{e.error&&b(k)})}G(()=>{re(a,"for",e.field.name),$(u,`${e.field.label??""} `),re(g,"id",e.field.name),g.disabled=l(i),be(g,1,`h-10 flex-1 rounded-md border bg-background px-3 text-sm focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-60 ${e.error?"border-destructive":""}`),re(g,"placeholder",e.field.label),re(p,"title",l(i)?"Edit manually":"Auto-generate")}),zt(g,t),Z("click",p,o),y(n,s),de()}ve(["click"]);var mE=M('<span class="text-destructive">*</span>'),_E=M('<p class="mt-1 text-xs text-destructive"> </p>'),bE=M('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <div class="flex items-center gap-2"><input type="color" class="h-10 w-12 cursor-pointer rounded border p-1"/> <input type="text" placeholder="#000000"/></div> <!></div>');function yE(n,e){ce(e,!0);let t=se(e,"value",15),r=U(()=>t()&&/^#[0-9a-fA-F]{6}$/.test(t())?t():"#000000");function i(m){t(m.target.value)}var o=bE(),s=w(o),a=w(s),u=N(a);{var c=m=>{var h=mE();y(m,h)};W(u,m=>{e.field.required&&m(c)})}var d=N(s,2),f=w(d),g=N(f,2);re(g,"maxlength",7);var p=N(d,2);{var v=m=>{var h=_E(),x=w(h);G(()=>$(x,e.error)),y(m,h)};W(p,m=>{e.error&&m(v)})}G(()=>{re(s,"for",e.field.name),$(a,`${e.field.label??""} `),ir(f,l(r)),re(g,"id",e.field.name),be(g,1,`h-10 flex-1 rounded-md border bg-background px-3 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-ring ${e.error?"border-destructive":""}`)}),Z("input",f,i),zt(g,t),y(n,o),de()}ve(["input"]);var xE=M('<span class="text-destructive">*</span>'),wE=M('<div class="grid grid-cols-[1fr_1fr_auto] gap-2 text-xs text-muted-foreground"><span>Key</span> <span>Value</span> <span class="w-8"></span></div>'),SE=M('<div class="grid grid-cols-[1fr_1fr_auto] gap-2"><input type="text" placeholder="key"/> <input type="text" placeholder="value"/> <button type="button" class="flex h-9 w-8 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive" title="Remove"><!></button></div>'),kE=M('<p class="mt-1 text-xs text-destructive"> </p>'),CE=M('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <div class="space-y-2"><!> <!> <button type="button" class="inline-flex h-9 items-center gap-1.5 rounded-md border border-dashed px-3 text-sm text-muted-foreground hover:border-primary hover:text-primary"><!> Add entry</button></div> <!></div>');function EE(n,e){ce(e,!0);let t=se(e,"value",15);function r(E){let D={};if(typeof E=="string")try{D=JSON.parse(E)}catch{return[]}else E&&typeof E=="object"&&!Array.isArray(E)&&(D=E);const L=Object.entries(D);return L.length>0?L.map(([V,J])=>({key:V,value:String(J)})):[]}let i=X(Be(r(t())));function o(){const E={};for(const D of l(i)){const L=D.key.trim();L&&(E[L]=D.value)}t(JSON.stringify(E))}let s=X(Be(t()));nt(()=>{if(t()!==l(s)){const E=r(t());JSON.stringify(E)!==JSON.stringify(l(i).map(D=>({key:D.key,value:D.value})))&&A(i,E,!0),A(s,t(),!0)}});function a(){l(i).push({key:"",value:""})}function u(E){l(i).splice(E,1),o()}function c(E,D){l(i)[E].key=D.target.value,o()}function d(E,D){l(i)[E].value=D.target.value,o()}function f(E){E.key==="Enter"&&(E.preventDefault(),a())}var g=CE(),p=w(g),v=w(p),m=N(v);{var h=E=>{var D=xE();y(E,D)};W(m,E=>{e.field.required&&E(h)})}var x=N(p,2),_=w(x);{var S=E=>{var D=wE();y(E,D)};W(_,E=>{l(i).length>0&&E(S)})}var k=N(_,2);Re(k,17,()=>l(i),gt,(E,D,L)=>{var V=SE(),J=w(V),R=N(J,2),P=N(R,2),K=w(P);or(K,{class:"h-4 w-4"}),G(()=>{ir(J,l(D).key),be(J,1,`h-9 rounded-md border bg-background px-3 text-sm focus:outline-none focus:ring-2 focus:ring-ring ${e.error?"border-destructive":""}`),ir(R,l(D).value),be(R,1,`h-9 rounded-md border bg-background px-3 text-sm focus:outline-none focus:ring-2 focus:ring-ring ${e.error?"border-destructive":""}`)}),Z("input",J,Q=>c(L,Q)),Z("keydown",J,f),Z("input",R,Q=>d(L,Q)),Z("keydown",R,f),Z("click",P,()=>u(L)),y(E,V)});var b=N(k,2),C=w(b);tc(C,{class:"h-4 w-4"});var T=N(x,2);{var O=E=>{var D=kE(),L=w(D);G(()=>$(L,e.error)),y(E,D)};W(T,E=>{e.error&&E(O)})}G(()=>{re(p,"for",e.field.name),$(v,`${e.field.label??""} `)}),Z("click",b,a),y(n,g),de()}ve(["input","keydown","click"]);var TE=M('<span class="text-destructive">*</span>'),NE=M('<span class="inline-flex items-center gap-1 rounded-full bg-primary/10 px-2.5 py-0.5 text-xs font-medium text-primary"> <button type="button" class="hover:text-destructive"><!></button></span>'),AE=M('<p class="mt-1 text-xs text-muted-foreground"> </p>'),OE=M('<p class="mt-1 text-xs text-destructive"> </p>'),ME=M('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <div><!> <input type="text" class="min-w-[120px] flex-1 bg-transparent py-1 text-sm outline-none placeholder:text-muted-foreground"/></div> <!> <!></div>');function PE(n,e){ce(e,!0);let t=se(e,"value",15),r=U(()=>Array.isArray(t())?t():[]),i=X("");function o(b){const C=b.trim();C&&(l(r).includes(C)||e.field.maxItems&&l(r).length>=e.field.maxItems||(t([...l(r),C]),A(i,"")))}function s(b){t(l(r).filter((C,T)=>T!==b))}function a(b){(b.key==="Enter"||b.key===",")&&(b.preventDefault(),o(l(i))),b.key==="Backspace"&&!l(i)&&l(r).length>0&&s(l(r).length-1)}function u(b){const C=b.clipboardData?.getData("text");if(C?.includes(",")){b.preventDefault();const T=C.split(",");for(const O of T)o(O)}}var c=ME(),d=w(c),f=w(d),g=N(f);{var p=b=>{var C=TE();y(b,C)};W(g,b=>{e.field.required&&b(p)})}var v=N(d,2),m=w(v);Re(m,17,()=>l(r),gt,(b,C,T)=>{var O=NE(),E=w(O),D=N(E),L=w(D);or(L,{class:"h-3 w-3"}),G(()=>$(E,`${l(C)??""} `)),Z("click",D,()=>s(T)),y(b,O)});var h=N(m,2),x=N(v,2);{var _=b=>{var C=AE(),T=w(C);G(()=>$(T,`${l(r).length??""}/${e.field.maxItems??""} items`)),y(b,C)};W(x,b=>{e.field.maxItems&&b(_)})}var S=N(x,2);{var k=b=>{var C=OE(),T=w(C);G(()=>$(T,e.error)),y(b,C)};W(S,b=>{e.error&&b(k)})}G(b=>{re(d,"for",e.field.name),$(f,`${e.field.label??""} `),be(v,1,`flex min-h-10 w-full flex-wrap items-center gap-1.5 rounded-md border bg-background px-3 py-1.5 focus-within:ring-2 focus-within:ring-ring ${e.error?"border-destructive":""}`),re(h,"id",e.field.name),re(h,"placeholder",b)},[()=>l(r).length===0?`Add ${e.field.label.toLowerCase()}...`:"Add more..."]),Z("keydown",h,a),Bn("paste",h,u),zt(h,()=>l(i),b=>A(i,b)),y(n,c),de()}ve(["click","keydown"]);var DE=M('<p class="parse-error svelte-13ec6kv"> </p>'),FE=M('<div class="card svelte-13ec6kv"><header class="svelte-13ec6kv"><span class="title svelte-13ec6kv"> </span> <div class="actions svelte-13ec6kv"><button type="button" aria-label="Move up" class="svelte-13ec6kv">▲</button> <button type="button" aria-label="Move down" class="svelte-13ec6kv">▼</button> <button type="button" aria-label="Delete" class="svelte-13ec6kv">×</button></div></header> <textarea rows="6"></textarea> <!> <button type="button">Save</button></div>');function Wp(n,e){ce(e,!0);const t=U(()=>{const{id:S,...k}=e.value;return k});let r=X(Be(JSON.stringify(l(t),null,2))),i=X("");function o(){try{const S=JSON.parse(l(r));A(i,""),e.onChange({...S,id:e.value.id})}catch(S){A(i,S.message,!0)}}nt(()=>{A(r,JSON.stringify(l(t),null,2),!0)});var s=FE(),a=w(s),u=w(a),c=w(u),d=N(u,2),f=w(d),g=N(f,2),p=N(g,2),v=N(a,2);let m;var h=N(v,2);{var x=S=>{var k=DE(),b=w(k);G(()=>$(b,l(i))),y(S,k)};W(h,S=>{l(i)&&S(x)})}var _=N(h,2);G(()=>{$(c,e.title),f.disabled=!e.canMoveUp,g.disabled=!e.canMoveDown,m=be(v,1,"svelte-13ec6kv",null,m,{error:!!l(i)})}),Z("click",f,function(...S){e.onMoveUp?.apply(this,S)}),Z("click",g,function(...S){e.onMoveDown?.apply(this,S)}),Z("click",p,function(...S){e.onDelete?.apply(this,S)}),zt(v,()=>l(r),S=>A(r,S)),Z("click",_,o),y(n,s),de()}ve(["click"]);var IE=M('<label class="svelte-c5uqx8"> </label>'),LE=M('<div class="array-field svelte-c5uqx8"><!> <!> <button type="button"> </button></div>');function RE(n,e){ce(e,!0);const t=U(()=>Array.isArray(e.value)?e.value:[]),r=U(()=>e.field.labels?.singular??"Item");function i(){return crypto.randomUUID()}function o(){e.onChange([...l(t),{id:i()}])}function s(h,x){const _=[...l(t)];_[h]=x,e.onChange(_)}function a(h){e.onChange(l(t).filter((x,_)=>_!==h))}function u(h){if(h===0)return;const x=[...l(t)];[x[h-1],x[h]]=[x[h],x[h-1]],e.onChange(x)}function c(h){if(h===l(t).length-1)return;const x=[...l(t)];[x[h],x[h+1]]=[x[h+1],x[h]],e.onChange(x)}var d=LE(),f=w(d);{var g=h=>{var x=IE(),_=w(x);G(()=>$(_,e.field.label)),y(h,x)};W(f,h=>{e.field.label&&h(g)})}var p=N(f,2);Re(p,19,()=>l(t),h=>h.id,(h,x,_)=>{{let S=U(()=>l(r)),k=U(()=>l(_)+1),b=U(()=>l(_)>0),C=U(()=>l(_)<l(t).length-1);Wp(h,{get title(){return`${l(S)??""} #${l(k)??""}`},get value(){return l(x)},get canMoveUp(){return l(b)},get canMoveDown(){return l(C)},onChange:T=>s(l(_),T),onMoveUp:()=>u(l(_)),onMoveDown:()=>c(l(_)),onDelete:()=>a(l(_))})}});var v=N(p,2),m=w(v);G(()=>$(m,`+ Add ${l(r)??""}`)),Z("click",v,o),y(n,d),de()}ve(["click"]);var zE=M('<label class="svelte-12ogf0n"> </label>'),BE=M("<option> </option>"),UE=M('<div class="blocks-field svelte-12ogf0n"><!> <!> <div class="add-bar svelte-12ogf0n"><select></select> <button type="button">+ Add Block</button></div></div>');function jE(n,e){ce(e,!0);const t=U(()=>Array.isArray(e.value)?e.value:[]);let r=X(Be(e.field.blocks[0]?.slug??""));function i(){return crypto.randomUUID()}function o(_){return{id:i(),blockType:_}}function s(){l(r)&&e.onChange([...l(t),o(l(r))])}function a(_,S){const k=[...l(t)];k[_]=S,e.onChange(k)}function u(_){e.onChange(l(t).filter((S,k)=>k!==_))}function c(_){if(_===0)return;const S=[...l(t)];[S[_-1],S[_]]=[S[_],S[_-1]],e.onChange(S)}function d(_){if(_===l(t).length-1)return;const S=[...l(t)];[S[_],S[_+1]]=[S[_+1],S[_]],e.onChange(S)}var f=UE(),g=w(f);{var p=_=>{var S=zE(),k=w(S);G(()=>$(k,e.field.label)),y(_,S)};W(g,_=>{e.field.label&&_(p)})}var v=N(g,2);Re(v,19,()=>l(t),_=>_.id,(_,S,k)=>{{let b=U(()=>l(k)+1),C=U(()=>l(S).blockType??"?"),T=U(()=>l(k)>0),O=U(()=>l(k)<l(t).length-1);Wp(_,{get title(){return`Block #${l(b)??""} · ${l(C)??""}`},get value(){return l(S)},get canMoveUp(){return l(T)},get canMoveDown(){return l(O)},onChange:E=>a(l(k),E),onMoveUp:()=>c(l(k)),onMoveDown:()=>d(l(k)),onDelete:()=>u(l(k))})}});var m=N(v,2),h=w(m);Re(h,21,()=>e.field.blocks,gt,(_,S)=>{var k=BE(),b=w(k),C={};G(()=>{$(b,l(S).label),C!==(C=l(S).slug)&&(k.value=(k.__value=l(S).slug)??"")}),y(_,k)});var x=N(h,2);vh(h,()=>l(r),_=>A(r,_)),Z("click",x,s),y(n,f),de()}ve(["click"]);var WE=M('<span class="text-destructive">*</span>'),KE=M('<p class="mt-1 text-xs text-destructive"> </p>'),HE=M('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <input type="password" autocomplete="new-password" placeholder="leave empty to keep unchanged"/> <!></div>');function VE(n,e){ce(e,!0);let t=se(e,"value",15);var r=HE(),i=w(r),o=w(i),s=N(o);{var a=f=>{var g=WE();y(f,g)};W(s,f=>{e.field.required&&f(a)})}var u=N(i,2),c=N(u,2);{var d=f=>{var g=KE(),p=w(g);G(()=>$(p,e.error)),y(f,g)};W(c,f=>{e.error&&f(d)})}G(()=>{re(i,"for",e.field.name),$(o,`${e.field.label??""} `),re(u,"id",e.field.name),re(u,"name",e.field.name),be(u,1,`h-10 w-full rounded-md border bg-background px-3 text-sm focus:outline-none focus:ring-2 focus:ring-ring ${e.error?"border-destructive":""}`),re(u,"minlength",e.field.minLength),re(u,"maxlength",e.field.maxLength)}),zt(u,t),y(n,r),de()}const Kp={text:dl,textarea:E1,number:O1,email:F1,select:B1,checkbox:W1,date:J1,richtext:yC,relationship:RC,file:JC,upload:dE,slug:pE,color:yE,json:EE,tags:PE,array:RE,blocks:jE,url:dl,uuid:dl};function Wc(n){return n.type==="text"&&n.variant==="password"?VE:Kp[n.type]}var JE=M('<button type="button"> </button>'),qE=M('<div class="text-xs text-muted-foreground"> </div>'),GE=M('<div class="rounded-lg border border-border/60 bg-card"><div class="flex border-b border-border/60"></div> <div class="space-y-4 p-4"><!></div></div>');function YE(n,e){ce(e,!0);let t=se(e,"formData",31,()=>Be({})),r=se(e,"errors",19,()=>({})),i=X(0);var o=GE(),s=w(o);Re(s,21,()=>e.field.tabs,gt,(f,g,p)=>{var v=JE(),m=w(v);G(()=>{be(v,1,`px-4 py-2.5 text-sm font-medium transition-colors ${l(i)===p?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`),$(m,l(g).label)}),Z("click",v,()=>A(i,p,!0)),y(f,v)});var a=N(s,2),u=w(a);{var c=f=>{var g=te(),p=q(g);Dt(p,()=>e.children),y(f,g)},d=f=>{var g=te(),p=q(g);Re(p,17,()=>e.field.tabs[l(i)].fields,v=>v.name,(v,m)=>{const h=U(()=>Wc(l(m)));var x=te(),_=q(x);{var S=b=>{var C=te(),T=q(C);Vt(T,()=>l(h),(O,E)=>{E(O,{get field(){return l(m)},get error(){return r()[l(m).name]},get value(){return t()[l(m).name]},set value(D){t(t()[l(m).name]=D,!0)}})}),y(b,C)},k=b=>{var C=qE(),T=w(C);G(()=>$(T,`Unsupported field type: ${l(m).type??""}`)),y(b,C)};W(_,b=>{l(h)?b(S):b(k,-1)})}y(v,x)}),y(f,g)};W(u,f=>{e.children?f(c):e.field.tabs[l(i)]&&f(d,1)})}y(n,o),de()}ve(["click"]);Kp.tabs=YE;var ZE=M('<p class="text-sm text-muted-foreground"> </p>'),XE=M('<div class="grid gap-4"></div>'),QE=M('<div class="grid gap-4"></div>'),$E=M('<div class="space-y-6"></div>');function Hp(n,e){ce(e,!0);const t=(p,v=Ot)=>{const m=U(()=>Wc(v()));var h=te(),x=q(h);{var _=k=>{var b=te(),C=q(b);Vt(C,()=>l(m),(T,O)=>{O(T,{get field(){return v()},get error(){return l(f)[v().name]},get formData(){return a()},get value(){return a()[v().name]},set value(E){a(a()[v().name]=E,!0)}})}),y(k,b)},S=k=>{var b=ZE(),C=w(b);G(()=>$(C,`Unknown field type: ${v().type??""}`)),y(k,b)};W(x,k=>{l(m)?k(_):k(S,-1)})}y(p,h)};se(e,"initialData",19,()=>({}));let r=se(e,"errors",19,()=>({})),i=se(e,"sidebarFields",19,()=>[]),o=se(e,"tabsField",3,void 0),s=se(e,"activeTab",3,0),a=se(e,"formData",31,()=>Be({})),u=U(()=>new Set(i())),c=U(()=>e.fields.filter(p=>!p.hidden&&!l(u).has(p.name))),d=Be({}),f=U(()=>({...r(),...d}));var g=$E();Re(g,23,()=>l(c),(p,v)=>p.name||`${p.type}-${v}`,(p,v)=>{var m=te(),h=q(m);{var x=k=>{var b=te(),C=q(b);{var T=O=>{var E=te(),D=q(E);Re(D,17,()=>o().tabs[s()].fields??[],L=>L.name,(L,V)=>{var J=te(),R=q(J);{var P=Q=>{var ee=XE();Re(ee,21,()=>(l(V).fields??[]).filter(H=>!H.hidden),H=>H.name,(H,j)=>{t(H,()=>l(j))}),G(()=>Qn(ee,`grid-template-columns: repeat(${(l(V).fields??[]).length??""}, minmax(0, 1fr));`)),y(Q,ee)},K=Q=>{t(Q,()=>l(V))};W(R,Q=>{l(V).type==="row"?Q(P):Q(K,-1)})}y(L,J)}),y(O,E)};W(C,O=>{o()&&o().tabs&&o().tabs[s()]&&O(T)})}y(k,b)},_=k=>{var b=QE();Re(b,21,()=>(l(v).fields??[]).filter(C=>!C.hidden),C=>C.name,(C,T)=>{t(C,()=>l(T))}),G(()=>Qn(b,`grid-template-columns: repeat(${(l(v).fields??[]).length??""}, minmax(0, 1fr));`)),y(k,b)},S=k=>{t(k,()=>l(v))};W(h,k=>{l(v).type==="tabs"?k(x):l(v).type==="row"?k(_,1):k(S,-1)})}y(p,m)}),y(n,g),de()}function Vp(n,e){if(n===e)return!0;if(typeof n!=typeof e||n===null||e===null||typeof n!="object")return!1;const t=Object.keys(n),r=Object.keys(e);if(t.length!==r.length)return!1;for(const i of t)if(!Vp(n[i],e[i]))return!1;return!0}function eT(n,e){const t=U(()=>!Vp(n(),e()));let r=!1;return ht(()=>{function i(o){!l(t)||r||(o.preventDefault(),o.returnValue="")}return window.addEventListener("beforeunload",i),()=>window.removeEventListener("beforeunload",i)}),Gb(({cancel:i})=>{r||l(t)&&!confirm("You have unsaved changes. Leave anyway?")&&i()}),{get isDirty(){return l(t)},allowNavigation(){r=!0}}}var tT=M('<aside class="space-y-5 lg:sticky lg:top-[260px] lg:self-start"><!> <!></aside>'),nT=M('<div><div class="min-w-0"><!></div> <!></div>'),rT=M("<!> <!> <!>",1);function Jp(n,e){ce(e,!0);const t=z=>{var F=te(),I=q(F);{var Y=ie=>{{let ue=U(()=>e.collection.versions?.drafts?.autosave?.interval??2e3);n1(ie,{get collectionKey(){return e.collection.key},get recordId(){return r().id},get formData(){return l(u)},get interval(){return l(ue)}})}};W(I,ie=>{l(h)&&l(f)==="edit"&&r()?.id&&ie(Y)})}y(z,F)};let r=se(e,"record",7,null),i=se(e,"isSubmitting",3,!1),o=se(e,"errors",19,()=>({}));function s(z){const F=[];for(const I of z){if(I.type==="tabs"){const Y=I.tabs??[];for(const ie of Y)F.push(...s(ie.fields??[]));continue}if(I.type==="row"){F.push(...s(I.fields??[]));continue}F.push(I)}return F}function a(z,F){const I={};for(const Y of s(z))if(F[Y.name]!==void 0&&F[Y.name]!==null){let ie=F[Y.name];if(Y.type==="tags"&&typeof ie=="string")try{ie=JSON.parse(ie)}catch{ie=[]}I[Y.name]=ie}else Y.defaultValue!==void 0?I[Y.name]=Y.defaultValue:Y.type==="checkbox"?I[Y.name]=!1:Y.type==="tags"?I[Y.name]=[]:Y.type==="number"||Y.type==="file"||Y.type==="relationship"||Y.type==="richtext"?I[Y.name]=null:I[Y.name]="";return I}let u=X(Be(a(e.collection.fields,r()??{}))),c=X(Be(a(e.collection.fields,r()??{}))),d=X(Be(r()?.id??"__new__")),f=X("edit");function g(z){A(f,z,!0)}nt(()=>{const z=r()?.id??"__new__";l(d)!==z&&(A(u,a(e.collection.fields,r()??{}),!0),A(c,a(e.collection.fields,r()??{}),!0),A(d,z,!0))});const p=eT(()=>l(u),()=>l(c));let v=U(()=>{const z=e.collection.admin?.useAsTitle;return z&&l(u)[z]?String(l(u)[z]):e.mode==="create"?`New ${e.collection.label}`:r()?.id??e.collection.label}),m=U(()=>e.collection.versions?.drafts!=null),h=U(()=>e.collection.versions?.drafts?.autosave!=null),x=U(()=>e.collection.versions?.drafts?.schedulePublish===!0),_=X(!1),S=X(!1),k=U(()=>l(u)._status??r()?._status??"draft"),b=U(()=>l(m)?e.mode==="create"?l(k)==="published"?"Publish":"Create draft":l(k)==="published"?"Publish changes":"Save draft":(e.mode==="create","Save")),C=U(()=>e.collection.fields.find(z=>z.type==="tabs")),T=U(()=>l(C)?(l(C).tabs??[]).map(z=>({label:z.label})):[]),O=X(0),E=U(()=>e.collection.admin?.sidebarFields??[]),D=U(()=>new Set(l(E))),L=U(()=>e.collection.fields.filter(z=>!z.hidden&&l(D).has(z.name)));function V(){const z={};for(const F of Object.keys(l(u))){const I=l(u)[F];I==null||I===""||(z[F]=I)}A(c,{...l(u)},!0),p.allowNavigation(),e.onSave(z)}function J(z){l(m)&&(l(u)._status=z),V()}async function R(){if(!r()?.id)return;const z=await jx(e.collection.key,r().id);z.ok?(l(u)._status="draft",A(c,{...l(u)},!0),r(z.data),ze.success("Record unpublished")):ze.error(z.error)}function P(){A(_,!0)}function K(z){A(S,!0),l(u).publishAt=z,l(u)._status="draft",A(_,!1);try{V(),ze.success(`Scheduled to publish at ${new Date(z).toLocaleString()}`)}finally{A(S,!1)}}var Q=rT(),ee=q(Q);e1(ee,{get collection(){return e.collection},get liveTitle(){return l(v)},get record(){return r()},get mode(){return e.mode},get status(){return l(k)},get saveLabel(){return l(b)},get isDirty(){return p.isDirty},get isSubmitting(){return i()},onSave:V,onSaveAs:J,onUnpublish:R,onSchedule:P,get tabs(){return l(T)},get headerMode(){return l(f)},setHeaderMode:g,get hasDrafts(){return l(m)},get hasSchedulePublish(){return l(x)},get metaExtra(){return t},get activeTab(){return l(O)},set activeTab(z){A(O,z,!0)}});var H=N(ee,2);{let z=U(()=>l(u).publishAt??"");_1(H,{get initialValue(){return l(z)},get isSubmitting(){return l(S)},onSchedule:K,get open(){return l(_)},set open(F){A(_,F,!0)}})}var j=N(H,2);{var ne=z=>{{let F=U(()=>r()?.id??null);g1(z,{get collectionKey(){return e.collection.key},get recordId(){return l(F)},get mode(){return e.mode},onApply:()=>A(f,"edit"),get formData(){return l(u)},set formData(I){A(u,I,!0)}})}},B=z=>{var F=nT(),I=w(F),Y=w(I);{let we=U(()=>r()??{});Hp(Y,{get fields(){return e.collection.fields},get initialData(){return l(we)},get errors(){return o()},get sidebarFields(){return l(E)},get tabsField(){return l(C)},get activeTab(){return l(O)},get formData(){return l(u)},set formData(me){A(u,me,!0)}})}var ie=N(I,2);{var ue=we=>{var me=tT(),ge=w(me);Re(ge,17,()=>l(L),Oe=>Oe.name,(Oe,he)=>{const et=U(()=>Wc(l(he)));var Ye=te(),Ct=q(Ye);{var Tt=Fe=>{var tt=te(),ye=q(tt);Vt(ye,()=>l(et),(Ce,Pe)=>{Pe(Ce,{get field(){return l(he)},get error(){return o()[l(he).name]},get formData(){return l(u)},get value(){return l(u)[l(he).name]},set value(Le){l(u)[l(he).name]=Le}})}),y(Fe,tt)};W(Ct,Fe=>{l(et)&&Fe(Tt)})}y(Oe,Ye)});var Te=N(ge,2);{var Ne=Oe=>{v1(Oe,{get collectionKey(){return e.collection.key},get recordId(){return r().id}})};W(Te,Oe=>{e.collection.versions&&e.mode==="edit"&&r()?.id&&Oe(Ne)})}y(we,me)};W(ie,we=>{(l(L).length>0||e.collection.versions&&e.mode==="edit"&&r()?.id)&&we(ue)})}G(()=>be(F,1,`grid gap-9 px-7 py-8 ${l(L).length>0||e.collection.versions&&e.mode==="edit"&&r()?.id?"lg:grid-cols-[1fr_320px]":""}`)),y(z,F)};W(j,z=>{l(f)==="api"?z(ne):z(B,-1)})}y(n,Q),de()}var iT=M('<div class="flex h-full items-center justify-center"><p class="text-muted-foreground">Collection not found</p></div>'),oT=M('<div class="flex h-full items-center justify-center"><div class="flex flex-col items-center gap-3"><div class="h-6 w-6 rounded-full border-2 border-primary/20 border-t-primary animate-spin-slow"></div> <p class="text-sm text-muted-foreground">Creating draft...</p></div></div>');function sT(n,e){ce(e,!0);let t=U(()=>pn.params.collection??""),r=U(()=>po(en.collections,l(t))),i=X(!1),o=X(Be({})),s=X(!1);ht(async()=>{if(!l(r))return;if(l(r).versions?.drafts?.autosave!=null){A(s,!0);const v=await Ql(l(t),{_status:"draft"},{draft:!0});A(s,!1),v.ok&&v.data.id&&await Tn(Je(`/${l(t)}/${v.data.id}`),{})}});async function a(p){if(!l(r))return;A(i,!0),A(o,{},!0);const v=p._status==="draft",m=await Ql(l(t),p,{draft:v});A(i,!1),m.ok?(ze.success("Record created"),await Tn(Je(`/${l(t)}/${m.data.id}`))):(m.details&&A(o,m.details,!0),ze.error(m.error))}var u=te(),c=q(u);{var d=p=>{var v=iT();y(p,v)},f=p=>{var v=oT();y(p,v)},g=p=>{Jp(p,{get collection(){return l(r)},mode:"create",get isSubmitting(){return l(i)},get errors(){return l(o)},onSave:a})};W(c,p=>{l(r)?l(s)?p(f,1):p(g,-1):p(d)})}y(n,u),de()}var aT=M('<div class="flex h-full items-center justify-center"><p class="text-muted-foreground">Collection not found</p></div>'),lT=M('<div class="flex h-full items-center justify-center"><div class="flex flex-col items-center gap-3"><div class="h-6 w-6 rounded-full border-2 border-primary/20 border-t-primary animate-spin-slow"></div> <p class="text-sm text-muted-foreground">Loading...</p></div></div>'),uT=M('<div class="flex h-full items-center justify-center"><p class="text-muted-foreground">Record not found</p></div>'),cT=M('<div class="border-b border-amber-200 bg-amber-50 px-7 py-2.5 text-sm text-amber-800">This document is being edited by <strong> </strong>. Your changes may be overwritten.</div>'),dT=M("<!> <!> <!>",1);function fT(n,e){ce(e,!0);let t=U(()=>pn.params.collection??""),r=U(()=>pn.params.id??""),i=U(()=>po(en.collections,l(t))),o=X(null),s=X(!0),a=X(!1),u=X(Be({})),c=X(!1),d=X(!1),f=X(null),g;ht(async()=>{const b=l(i)?.versions?.drafts!=null,C=await ia(l(t),l(r),"*",{draft:b});if(A(s,!1),C.ok){A(o,C.data,!0);const T=await fd(l(t),l(r));T.ok&&T.data.locked&&T.data.lock&&A(f,{userName:T.data.lock.userName},!0),g=setInterval(async()=>{await fd(l(t),l(r))},120*1e3)}else ze.error(C.error)}),V_(()=>{g&&clearInterval(g),Wx(l(t),l(r))});async function p(b){A(a,!0),A(u,{},!0);const C=b._status==="draft",T=await Ih(l(t),l(r),b,{draft:C});A(a,!1),T.ok?(A(o,T.data,!0),ze.success("Record updated")):(T.details&&A(u,T.details,!0),ze.error(T.error))}async function v(){A(d,!0);const b=await Lh(l(t),l(r));A(d,!1),A(c,!1),b.ok?(ze.success("Record deleted"),await Tn(Je(`/${l(t)}`))):ze.error(b.error)}var m=te(),h=q(m);{var x=b=>{var C=aT();y(b,C)},_=b=>{var C=lT();y(b,C)},S=b=>{var C=uT();y(b,C)},k=b=>{var C=dT(),T=q(C);{var O=L=>{var V=cT(),J=N(w(V)),R=w(J);G(()=>$(R,l(f).userName)),y(L,V)};W(T,L=>{l(f)&&L(O)})}var E=N(T,2);Jp(E,{get collection(){return l(i)},get record(){return l(o)},mode:"edit",get isSubmitting(){return l(a)},get errors(){return l(u)},onSave:p});var D=N(E,2);zh(D,{get title(){return`Delete ${l(i).label??""}`},description:"Are you sure you want to delete this record? This action cannot be undone.",get isDeleting(){return l(d)},onConfirm:v,get open(){return l(c)},set open(L){A(c,L,!0)}}),y(b,C)};W(h,b=>{l(i)?l(s)?b(_,1):l(o)?b(k,-1):b(S,2):b(x)})}y(n,m),de()}function qp(n,e,t){const r=new URLSearchParams;t?.page&&r.set("page",String(t.page)),t?.limit&&r.set("limit",String(t.limit));const i=r.toString()?`?${r.toString()}`:"";return jr(`/collections/${n}/records/${e}/versions${i}`)}function fg(n,e,t){return jr(`/collections/${n}/records/${e}/versions/${t}`)}function Gp(n,e,t,r=!0){return _i(`/collections/${n}/records/${e}/versions/${t}/restore?draft=${r}`,{})}var gT=M("<span> </span>");function Au(n,e){let t=se(e,"status",3,""),r=se(e,"isLatest",3,!1),i=U(()=>t()==="draft"&&r()?"Current Draft":t()==="draft"?"Draft":t()==="published"&&r()?"Published":t()==="published"?"Previously Published":t()||""),o=U(()=>t()==="draft"&&r()?"bg-amber-100 text-amber-800":t()==="published"&&r()?"bg-green-100 text-green-800":"bg-stone-100 text-stone-600");var s=te(),a=q(s);{var u=c=>{var d=gT(),f=w(d);G(()=>{be(d,1,`rounded-full px-2 py-0.5 text-[10px] font-semibold ${l(o)??""}`),$(f,l(i))}),y(c,d)};W(a,c=>{l(i)&&c(u)})}y(n,s)}var hT=M('<label class="mt-4 flex items-center gap-2 text-sm text-stone-700"><input type="checkbox" class="rounded"/> Restore as published</label>'),vT=M('<div class="fixed inset-0 z-50 flex items-center justify-center"><button class="absolute inset-0 bg-black/50" aria-label="Close modal"></button> <div class="relative z-10 w-full max-w-md rounded-lg bg-white p-6 shadow-xl"><h3 class="text-lg font-semibold text-stone-900">Restore Version</h3> <p class="mt-2 text-sm text-stone-600">This will replace current record data with data from this version.</p> <!> <div class="mt-6 flex justify-end gap-3"><button class="rounded-md px-4 py-2 text-sm font-medium text-stone-700 hover:bg-stone-100">Cancel</button> <button class="rounded-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 disabled:opacity-50"> </button></div></div></div>');function Yp(n,e){ce(e,!0);let t=se(e,"open",15,!1),r=X(!1);function i(){e.onRestore(!l(r))}function o(){t(!1),A(r,!1)}var s=te(),a=q(s);{var u=c=>{var d=vT(),f=w(d),g=N(f,2),p=N(w(g),4);{var v=S=>{var k=hT(),b=w(k);Zu(b,()=>l(r),C=>A(r,C)),y(S,k)};W(p,S=>{e.hasDrafts&&S(v)})}var m=N(p,2),h=w(m),x=N(h,2),_=w(x);G(()=>{h.disabled=e.isRestoring,x.disabled=e.isRestoring,$(_,e.isRestoring?"Restoring...":"Restore")}),Z("click",f,o),Z("click",h,o),Z("click",x,i),y(c,d)};W(a,c=>{t()&&c(u)})}y(n,s),de()}ve(["click"]);var pT=M('<div class="flex h-full items-center justify-center"><p class="text-muted-foreground">Collection not found</p></div>'),mT=M('<div class="flex h-full items-center justify-center"><div class="flex flex-col items-center gap-3"><div class="h-6 w-6 rounded-full border-2 border-primary/20 border-t-primary animate-spin-slow"></div> <p class="text-sm text-muted-foreground">Loading...</p></div></div>'),_T=M('<div class="flex flex-col items-center justify-center py-16"><p class="text-sm text-muted-foreground">No versions found</p></div>'),bT=M('<tr class="border-b border-border/40 transition-colors hover:bg-secondary/30"><td class="px-4 py-2.5"><a class="text-primary hover:underline"> </a></td><td class="px-4 py-2.5"><!></td><td class="px-4 py-2.5 text-muted-foreground"> </td><td class="px-4 py-2.5 text-right"><button type="button" class="inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground" title="Restore this version"><!></button></td></tr>'),yT=M('<!> <div class="overflow-x-auto rounded-lg border border-border/80 bg-card shadow-sm"><table class="w-full text-sm"><thead><tr class="border-b border-border/60 bg-secondary/40"><th class="px-4 py-2.5 text-left font-medium text-muted-foreground">Date</th><th class="px-4 py-2.5 text-left font-medium text-muted-foreground">Status</th><th class="px-4 py-2.5 text-left font-medium text-muted-foreground">Age</th><th class="px-4 py-2.5 text-right font-medium text-muted-foreground">Actions</th></tr></thead><tbody></tbody></table></div> <!>',1),xT=M('<div class="space-y-5"><nav class="flex items-center gap-1.5 text-sm text-muted-foreground"><a class="hover:text-foreground"> </a> <span>/</span> <a class="hover:text-foreground"> </a> <span>/</span> <span class="text-foreground font-medium">Versions</span></nav> <h1 class="text-xl font-semibold text-foreground">Version History</h1> <!></div> <!>',1);function wT(n,e){ce(e,!0);let t=U(()=>pn.params.collection??""),r=U(()=>pn.params.id??""),i=U(()=>po(en.collections,l(t))),o=X(Be([])),s=X(!0),a=X(1),u=20,c=X(0),d=X(!1),f=X(""),g=X(!1),p=U(()=>Math.max(1,Math.ceil(l(c)/u))),v=U(()=>l(o).find(J=>J._status==="published"&&J.latest)?.id??l(o).find(J=>J._status==="published")?.id??""),m=U(()=>l(o).find(J=>J._status==="draft"&&J.latest)?.id??""),h=U(()=>l(i)?.versions?.drafts!=null);async function x(V){A(s,!0);const J=await qp(l(t),l(r),{page:V,limit:u});A(s,!1),J.ok?(A(o,J.data.versions??[],!0),A(c,J.data.totalRecords??0,!0),A(a,V,!0)):ze.error(J.error)}ht(()=>{x(1)});function _(V){return V?new Date(V).toLocaleString():""}function S(V){if(!V)return"";const J=Date.now()-new Date(V).getTime(),R=Math.floor(J/1e3);if(R<60)return`${R}s ago`;const P=Math.floor(R/60);if(P<60)return`${P}m ago`;const K=Math.floor(P/60);return K<24?`${K}h ago`:`${Math.floor(K/24)}d ago`}function k(V){A(f,V,!0),A(d,!0)}async function b(V){A(g,!0);const J=await Gp(l(t),l(r),l(f),V);A(g,!1),A(d,!1),J.ok?(ze.success("Version restored"),await Tn(Je(`/${l(t)}/${l(r)}`))):ze.error(J.error)}function C(V){x(V)}var T=te(),O=q(T);{var E=V=>{var J=pT();y(V,J)},D=V=>{var J=mT();y(V,J)},L=V=>{var J=xT(),R=q(J),P=w(R),K=w(P),Q=w(K),ee=N(K,4),H=w(ee),j=N(P,4);{var ne=F=>{var I=_T();y(F,I)},B=F=>{var I=yT(),Y=q(I);sa(Y,{get page(){return l(a)},get totalPages(){return l(p)},get totalRecords(){return l(c)},perPage:u,onPageChange:C,class:"border-b border-border/60"});var ie=N(Y,2),ue=w(ie),we=N(w(ue));Re(we,21,()=>l(o),ge=>ge.id,(ge,Te)=>{var Ne=bT(),Oe=w(Ne),he=w(Oe),et=w(he),Ye=N(Oe),Ct=w(Ye);{let Pe=U(()=>l(Te)._status??""),Le=U(()=>l(Te).id===l(v)||l(Te).id===l(m));Au(Ct,{get status(){return l(Pe)},get isLatest(){return l(Le)}})}var Tt=N(Ye),Fe=w(Tt),tt=N(Tt),ye=w(tt),Ce=w(ye);jy(Ce,{class:"h-4 w-4"}),G((Pe,Le,Ke)=>{re(he,"href",Pe),$(et,Le),$(Fe,Ke)},[()=>Je(`/${l(t)}/${l(r)}/versions/${l(Te).id}`),()=>_(l(Te).createdAt),()=>S(l(Te).createdAt)]),Z("click",ye,()=>k(l(Te).id)),y(ge,Ne)});var me=N(ie,2);sa(me,{get page(){return l(a)},get totalPages(){return l(p)},get totalRecords(){return l(c)},perPage:u,onPageChange:C}),y(F,I)};W(j,F=>{l(o).length===0?F(ne):F(B,-1)})}var z=N(R,2);Yp(z,{get hasDrafts(){return l(h)},get isRestoring(){return l(g)},onRestore:b,get open(){return l(d)},set open(F){A(d,F,!0)}}),G((F,I)=>{re(K,"href",F),$(Q,l(i).labelPlural||l(i).label),re(ee,"href",I),$(H,l(r))},[()=>Je(`/${l(t)}`),()=>Je(`/${l(t)}/${l(r)}`)]),y(V,J)};W(O,V=>{l(i)?l(s)?V(D,1):V(L,-1):V(E)})}y(n,T),de()}ve(["click"]);function ST(n,e){return n===e||n==null&&e==null?!0:n==null||e==null?!1:typeof n=="object"&&typeof e=="object"?JSON.stringify(n)===JSON.stringify(e):!1}function Ou(n){if(n==null)return"";if(typeof n=="boolean")return n?"true":"false";if(Array.isArray(n))return n.join(", ");if(typeof n=="string"&&n.startsWith("{"))try{const e=JSON.parse(n);return Ou(e)}catch{return n}if(typeof n=="object"){const e=n;return e.root&&e.root.children?Zp(e.root.children):e.url&&e.filename?e.filename:e.url?e.url:JSON.stringify(n,null,2)}return String(n)}function Zp(n){const e=[];for(const t of n)if(t.text)e.push(t.text);else if(t.children){const r=Zp(t.children);r&&e.push(r)}return e.join(`
|
|
32
|
-
`)}function gg(n){return n.match(/\S+|\s+/g)??[]}function kT(n,e){const t=gg(n),r=gg(e),i=t.length,o=r.length,s=Array.from({length:i+1},()=>Array(o+1).fill(0));for(let f=1;f<=i;f++)for(let g=1;g<=o;g++)t[f-1]===r[g-1]?s[f][g]=s[f-1][g-1]+1:s[f][g]=Math.max(s[f-1][g],s[f][g-1]);const a=[];let u=i,c=o;const d=[];for(;u>0||c>0;)u>0&&c>0&&t[u-1]===r[c-1]?(d.push({type:"equal",value:t[u-1]}),u--,c--):c>0&&(u===0||s[u][c-1]>=s[u-1][c])?(d.push({type:"add",value:r[c-1]}),c--):(d.push({type:"delete",value:t[u-1]}),u--);d.reverse();for(const f of d)a.length>0&&a[a.length-1].type===f.type?a[a.length-1].value+=f.value:a.push({...f});return a}var CT=M('<img alt="old" class="h-16 w-16 rounded object-cover"/>'),ET=M('<span class="text-xs text-stone-400">No file</span>'),TT=M('<img alt="new" class="h-16 w-16 rounded object-cover"/>'),NT=M('<span class="text-xs text-stone-400">No file</span>'),AT=M('<div class="grid grid-cols-[1fr_auto_1fr] items-center gap-0"><div class="p-3"><!></div> <div class="w-px self-stretch bg-stone-200"></div> <div class="p-3"><!></div></div>'),OT=M('<div class="grid grid-cols-[1fr_auto_1fr] items-center gap-0"><div class="p-3"><span> </span></div> <div class="w-px self-stretch bg-stone-200"></div> <div class="p-3"><span> </span></div></div>'),MT=M("<span> </span>"),PT=M('<span class="bg-red-100 line-through"> </span>'),DT=M("<span> </span>"),FT=M('<span class="bg-green-100"> </span>'),IT=M('<div class="mt-2 grid grid-cols-[1fr_auto_1fr] gap-0"><div class="p-2 text-sm leading-relaxed"></div> <div class="w-px self-stretch bg-stone-200"></div> <div class="p-2 text-sm leading-relaxed"></div></div>'),LT=M('<div class="px-3 py-2"><button class="flex items-center gap-1 text-xs text-stone-600 hover:text-stone-900"><!> <span class="rounded bg-amber-100 px-1.5 py-0.5 text-[10px] font-medium text-amber-700">content changed</span></button> <!></div>'),RT=M("<span> </span>"),zT=M('<span class="bg-red-100 line-through"> </span>'),BT=M("<span> </span>"),UT=M('<span class="bg-green-100"> </span>'),jT=M('<div class="grid grid-cols-[1fr_auto_1fr] gap-0"><div class="p-3 text-sm leading-relaxed"></div> <div class="w-px self-stretch bg-stone-200"></div> <div class="p-3 text-sm leading-relaxed"></div></div>'),WT=M('<div class="border-b border-stone-200"><div class="bg-stone-50 px-3 py-1.5"><span class="text-[11px] font-semibold uppercase tracking-wide text-stone-500"> </span></div> <!></div>');function KT(n,e){ce(e,!0);let t=se(e,"fieldType",3,"text"),r=X(!1),i=U(()=>ST(e.oldValue,e.newValue)),o=U(()=>Ou(e.oldValue)),s=U(()=>Ou(e.newValue)),a=U(()=>kT(l(o),l(s)));var u=te(),c=q(u);{var d=f=>{var g=WT(),p=w(g),v=w(p),m=w(v),h=N(p,2);{var x=b=>{var C=AT(),T=w(C),O=w(T);{var E=P=>{var K=CT();G(()=>re(K,"src",l(o))),y(P,K)},D=P=>{var K=ET();y(P,K)};W(O,P=>{l(o)?P(E):P(D,-1)})}var L=N(T,4),V=w(L);{var J=P=>{var K=TT();G(()=>re(K,"src",l(s))),y(P,K)},R=P=>{var K=NT();y(P,K)};W(V,P=>{l(s)?P(J):P(R,-1)})}y(b,C)},_=b=>{var C=OT(),T=w(C),O=w(T),E=w(O),D=N(T,4),L=w(D),V=w(L);G(()=>{be(O,1,`rounded-full px-2 py-0.5 text-xs font-medium ${l(o)==="true"?"bg-green-100 text-green-800":"bg-red-100 text-red-800"}`),$(E,l(o)),be(L,1,`rounded-full px-2 py-0.5 text-xs font-medium ${l(s)==="true"?"bg-green-100 text-green-800":"bg-red-100 text-red-800"}`),$(V,l(s))}),y(b,C)},S=b=>{var C=LT(),T=w(C),O=w(T);{var E=J=>{ls(J,{size:14})},D=J=>{Qu(J,{size:14})};W(O,J=>{l(r)?J(E):J(D,-1)})}var L=N(T,2);{var V=J=>{var R=IT(),P=w(R);Re(P,21,()=>l(a),gt,(Q,ee)=>{var H=te(),j=q(H);{var ne=z=>{var F=MT(),I=w(F);G(()=>$(I,l(ee).value)),y(z,F)},B=z=>{var F=PT(),I=w(F);G(()=>$(I,l(ee).value)),y(z,F)};W(j,z=>{l(ee).type==="equal"?z(ne):l(ee).type==="delete"&&z(B,1)})}y(Q,H)});var K=N(P,4);Re(K,21,()=>l(a),gt,(Q,ee)=>{var H=te(),j=q(H);{var ne=z=>{var F=DT(),I=w(F);G(()=>$(I,l(ee).value)),y(z,F)},B=z=>{var F=FT(),I=w(F);G(()=>$(I,l(ee).value)),y(z,F)};W(j,z=>{l(ee).type==="equal"?z(ne):l(ee).type==="add"&&z(B,1)})}y(Q,H)}),y(J,R)};W(L,J=>{l(r)&&J(V)})}Z("click",T,()=>A(r,!l(r))),y(b,C)},k=b=>{var C=jT(),T=w(C);Re(T,21,()=>l(a),gt,(E,D)=>{var L=te(),V=q(L);{var J=P=>{var K=RT(),Q=w(K);G(()=>$(Q,l(D).value)),y(P,K)},R=P=>{var K=zT(),Q=w(K);G(()=>$(Q,l(D).value)),y(P,K)};W(V,P=>{l(D).type==="equal"?P(J):l(D).type==="delete"&&P(R,1)})}y(E,L)});var O=N(T,4);Re(O,21,()=>l(a),gt,(E,D)=>{var L=te(),V=q(L);{var J=P=>{var K=BT(),Q=w(K);G(()=>$(Q,l(D).value)),y(P,K)},R=P=>{var K=UT(),Q=w(K);G(()=>$(Q,l(D).value)),y(P,K)};W(V,P=>{l(D).type==="equal"?P(J):l(D).type==="add"&&P(R,1)})}y(E,L)}),y(b,C)};W(h,b=>{t()==="file"||t()==="upload"?b(x):t()==="checkbox"?b(_,1):t()==="richtext"?b(S,2):b(k,-1)})}G(()=>$(m,e.fieldLabel||e.fieldName)),y(f,g)};W(c,f=>{l(i)||f(d)})}y(n,u),de()}ve(["click"]);var HT=M("<option> </option>"),VT=M('<select class="rounded-md border border-stone-300 bg-white px-3 py-1.5 text-sm text-stone-700 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500"></select>');function JT(n,e){ce(e,!0);var t=VT();Re(t,21,()=>e.options,gt,(i,o)=>{var s=HT(),a=w(s),u={};G(c=>{$(a,`${l(o).label??""} — ${c??""}`),u!==(u=l(o).id)&&(s.value=(s.__value=l(o).id)??"")},[()=>oa(l(o).date)]),y(i,s)});var r;Yu(t),G(()=>{r!==(r=e.selected)&&(t.value=(t.__value=e.selected)??"",Ko(t,e.selected))}),Z("change",t,i=>e.onChange(i.target.value)),y(n,t),de()}ve(["change"]);var qT=M('<div class="flex h-full items-center justify-center"><p class="text-muted-foreground">Collection not found</p></div>'),GT=M('<div class="flex h-full items-center justify-center"><div class="flex flex-col items-center gap-3"><div class="h-6 w-6 rounded-full border-2 border-primary/20 border-t-primary animate-spin-slow"></div> <p class="text-sm text-muted-foreground">Loading...</p></div></div>'),YT=M('<div class="flex h-full items-center justify-center"><p class="text-muted-foreground">Version not found</p></div>'),ZT=M('<div class="flex flex-wrap items-center gap-2"><!> <!></div> <p class="text-xs text-muted-foreground"> </p>',1),XT=M('<p class="text-xs text-muted-foreground">No other version to compare</p>'),QT=M('<div class="flex flex-col items-center justify-center py-12"><p class="text-sm text-muted-foreground"> </p></div>'),$T=M('<div class="overflow-hidden rounded-lg border border-border/80 bg-card shadow-sm"></div>'),eN=M('<div class="space-y-5"><nav class="flex items-center gap-1.5 text-sm text-muted-foreground"><a class="hover:text-foreground"> </a> <span>/</span> <a class="hover:text-foreground"> </a> <span>/</span> <a class="hover:text-foreground">Versions</a> <span>/</span> <span class="text-foreground font-medium"> </span></nav> <div class="flex items-center justify-between"><h1 class="text-xl font-semibold text-foreground">Compare Versions</h1> <label class="flex items-center gap-2 text-sm text-muted-foreground"><input type="checkbox" class="rounded"/> Modified fields only</label></div> <div class="grid grid-cols-[1fr_auto_1fr] gap-0 rounded-lg border border-border/80 bg-card shadow-sm"><div class="p-4 space-y-2"><span class="text-[10px] font-semibold uppercase tracking-wide text-muted-foreground">Comparing Against</span> <!></div> <div class="w-px self-stretch bg-border/60"></div> <div class="p-4 space-y-2"><span class="text-[10px] font-semibold uppercase tracking-wide text-muted-foreground">Currently Viewing</span> <div class="flex flex-wrap items-center gap-2"><span class="text-sm font-medium text-foreground"> </span> <!></div> <div class="flex items-center gap-3"><p class="text-xs text-muted-foreground"> </p> <button type="button" class="text-xs font-medium text-primary hover:underline">Restore this version</button></div></div></div> <!></div> <!>',1);function tN(n,e){ce(e,!0);let t=U(()=>pn.params.collection??""),r=U(()=>pn.params.id??""),i=U(()=>pn.params.vid??""),o=U(()=>po(en.collections,l(t))),s=X(Be([])),a=X(null),u=X(null),c=X(!0),d=X(!0),f=X(!1),g=X(!1),p=U(()=>l(o)?.versions?.drafts!=null),v=U(()=>T(l(a))),m=U(()=>T(l(u)));const h=["id","createdAt","updatedAt","_versionId","_versionCreatedAt"];function x(H){const j=[];for(const ne of H){if(ne.type==="tabs"){for(const B of ne.tabs??[])j.push(...x(B.fields??[]));continue}j.push(ne)}return j}let _=U(()=>l(o)?x(l(o).fields).filter(H=>!H.hidden&&!h.includes(H.name)):[]),S=U(()=>l(d)?l(_).filter(H=>{const j=l(m)[H.name],ne=l(v)[H.name];return JSON.stringify(j)!==JSON.stringify(ne)}):l(_)),k=U(()=>l(s).find(j=>j._status==="published"&&j.latest)?.id??l(s).find(j=>j._status==="published")?.id??""),b=U(()=>l(s).find(j=>j._status==="draft"&&j.latest)?.id??""),C=U(()=>{const H=l(s).find(ne=>ne._status==="published");let j=!1;return l(s).filter(ne=>ne.id!==l(i)).map(ne=>{let B;return ne.latest&&ne._status==="draft"?B="Current Draft":ne._status==="published"&&ne.id===H?.id?B="Currently Published":ne._status==="published"?B="Previously Published":j?B="Version":(B="Previous Version",j=!0),{id:ne.id,label:B,status:ne._status,isLatest:ne.id===l(k)||ne.id===l(b),date:ne.createdAt}})});function T(H){if(!H)return{};const j=H.version;if(!j)return{};if(typeof j=="string")try{return JSON.parse(j)}catch{return{}}return typeof j=="object"?j:{}}function O(H){return H?new Date(H).toLocaleString():""}function E(H){if(!H)return"";const j=Date.now()-new Date(H).getTime(),ne=Math.floor(j/1e3);if(ne<60)return`${ne}s ago`;const B=Math.floor(ne/60);if(B<60)return`${B}m ago`;const z=Math.floor(B/60);return z<24?`${z}h ago`:`${Math.floor(z/24)}d ago`}async function D(H){const j=await fg(l(t),l(r),H);j.ok?A(u,j.data,!0):ze.error(j.error)}function L(H){D(H)}ht(async()=>{const[H,j]=await Promise.all([qp(l(t),l(r),{page:1,limit:50}),fg(l(t),l(r),l(i))]);if(!H.ok){A(c,!1),ze.error(H.error);return}if(!j.ok){A(c,!1),ze.error(j.error);return}A(s,H.data.versions??[],!0),A(a,j.data,!0);const ne=l(s).findIndex(z=>z.id===l(i)),B=ne>=0&&ne<l(s).length-1?l(s)[ne+1]:l(s).find(z=>z.id!==l(i));B&&await D(B.id),A(c,!1)});async function V(H){A(g,!0);const j=await Gp(l(t),l(r),l(i),H);A(g,!1),A(f,!1),j.ok?(ze.success("Version restored"),await Tn(Je(`/${l(t)}/${l(r)}`))):ze.error(j.error)}var J=te(),R=q(J);{var P=H=>{var j=qT();y(H,j)},K=H=>{var j=GT();y(H,j)},Q=H=>{var j=YT();y(H,j)},ee=H=>{var j=eN(),ne=q(j),B=w(ne),z=w(B),F=w(z),I=N(z,4),Y=w(I),ie=N(I,4),ue=N(ie,4),we=w(ue),me=N(B,2),ge=N(w(me),2),Te=w(ge),Ne=N(me,2),Oe=w(Ne),he=N(w(Oe),2);{var et=Ve=>{var lt=ZT(),ot=q(lt),Ze=w(ot);JT(Ze,{get options(){return l(C)},get selected(){return l(u).id},onChange:L});var dt=N(Ze,2);{let De=U(()=>l(u)._status??""),ut=U(()=>l(u).id===l(k)||l(u).id===l(b));Au(dt,{get status(){return l(De)},get isLatest(){return l(ut)}})}var Ie=N(ot,2),qe=w(Ie);G(De=>$(qe,De),[()=>E(l(u).createdAt)]),y(Ve,lt)},Ye=Ve=>{var lt=XT();y(Ve,lt)};W(he,Ve=>{l(u)?Ve(et):Ve(Ye,-1)})}var Ct=N(Oe,4),Tt=N(w(Ct),2),Fe=w(Tt),tt=w(Fe),ye=N(Fe,2);{let Ve=U(()=>l(a)._status??""),lt=U(()=>l(a).id===l(k)||l(a).id===l(b));Au(ye,{get status(){return l(Ve)},get isLatest(){return l(lt)}})}var Ce=N(Tt,2),Pe=w(Ce),Le=w(Pe),Ke=N(Pe,2),je=N(Ne,2);{var Me=Ve=>{var lt=QT(),ot=w(lt),Ze=w(ot);G(()=>$(Ze,l(d)?"No modified fields":"No fields to display")),y(Ve,lt)},wt=Ve=>{var lt=$T();Re(lt,21,()=>l(S),ot=>ot.name,(ot,Ze)=>{KT(ot,{get fieldName(){return l(Ze).name},get fieldLabel(){return l(Ze).label},get fieldType(){return l(Ze).type},get oldValue(){return l(m)[l(Ze).name]},get newValue(){return l(v)[l(Ze).name]}})}),y(Ve,lt)};W(je,Ve=>{l(S).length===0?Ve(Me):Ve(wt,-1)})}var Pt=N(ne,2);Yp(Pt,{get hasDrafts(){return l(p)},get isRestoring(){return l(g)},onRestore:V,get open(){return l(f)},set open(Ve){A(f,Ve,!0)}}),G((Ve,lt,ot,Ze,dt,Ie)=>{re(z,"href",Ve),$(F,l(o).labelPlural||l(o).label),re(I,"href",lt),$(Y,l(r)),re(ie,"href",ot),$(we,Ze),$(tt,dt),$(Le,Ie)},[()=>Je(`/${l(t)}`),()=>Je(`/${l(t)}/${l(r)}`),()=>Je(`/${l(t)}/${l(r)}/versions`),()=>O(l(a).createdAt),()=>O(l(a).createdAt),()=>E(l(a).createdAt)]),Zu(Te,()=>l(d),Ve=>A(d,Ve)),Z("click",Ke,()=>A(f,!0)),y(H,j)};W(R,H=>{l(o)?l(c)?H(K,1):l(a)?H(ee,-1):H(Q,2):H(P)})}y(n,J),de()}ve(["click"]);var nN=M('<div class="flex h-full items-center justify-center"><p class="text-muted-foreground">Loading...</p></div>'),rN=M('<div class="flex h-full items-center justify-center"><p class="text-muted-foreground">Loading...</p></div>'),iN=M('<p class="mt-1 text-sm text-muted-foreground"> </p>'),oN=M('<header class="sticky top-0 z-10 border-b border-border bg-background"><div class="flex items-center justify-between px-7 py-3.5"><div class="flex min-w-0 items-center gap-2.5 text-[13px] text-muted-foreground"><span class="font-medium text-foreground"> </span></div> <button type="button" class="bg-primary px-4 py-2 text-xs font-semibold tracking-wide text-primary-foreground rounded-lg shadow-sm transition-colors hover:bg-primary/90 disabled:opacity-60"> </button></div> <div class="px-7 pb-5 pt-5"><h1 class="font-display text-[28px] font-semibold leading-tight tracking-tight text-foreground"> </h1> <!></div></header> <div class="px-7 py-8"><div class="max-w-2xl"><!></div></div>',1);function sN(n,e){ce(e,!0);let t=U(()=>pn.params.key??""),r=U(()=>en.globals.find(h=>h.key===l(t))),i=X(Be({})),o=X(Be({})),s=X(!0),a=X(!1),u=X(Be({}));nt(()=>{l(t)&&l(r)&&c(l(t))});async function c(h){A(s,!0);const x=await Ph(h);A(s,!1),x.ok?(A(i,x.data,!0),A(o,{...x.data},!0)):ze.error(x.error)}async function d(){A(a,!0),A(u,{},!0);const h=await $y(l(t),l(o));A(a,!1),h.ok?(A(i,h.data,!0),A(o,{...h.data},!0),ze.success("Settings saved")):(h.details&&A(u,h.details,!0),ze.error(h.error))}var f=te(),g=q(f);{var p=h=>{var x=nN();y(h,x)},v=h=>{var x=rN();y(h,x)},m=h=>{var x=oN(),_=q(x),S=w(_),k=w(S),b=w(k),C=w(b),T=N(k,2),O=w(T),E=N(S,2),D=w(E),L=w(D),V=N(D,2);{var J=Q=>{var ee=iN(),H=w(ee);G(()=>$(H,l(r).description)),y(Q,ee)};W(V,Q=>{l(r).description&&Q(J)})}var R=N(_,2),P=w(R),K=w(P);Hp(K,{get fields(){return l(r).fields},get initialData(){return l(i)},get errors(){return l(u)},get formData(){return l(o)},set formData(Q){A(o,Q,!0)}}),G(()=>{$(C,l(r).label),T.disabled=l(a),$(O,l(a)?"Saving…":"Save"),$(L,l(r).label)}),Z("click",T,d),y(h,x)};W(g,h=>{l(r)?l(s)?h(v,1):h(m,-1):h(p)})}y(n,f),de()}ve(["click"]);var aN=M(`<div class="flex h-[60vh] flex-col items-center justify-center gap-2 text-center"><h1 class="text-2xl font-semibold">Page not found</h1> <p class="text-muted-foreground">The admin URL you followed doesn't match any known route.</p> <a class="text-primary underline mt-2">Back to dashboard</a></div>`);function Xp(n,e){ce(e,!1),os();var t=aN(),r=N(w(t),4);G(i=>re(r,"href",i),[()=>Je("/")]),y(n,t),de()}var lN=M('<div class="p-6 text-red-600"> </div>'),uN=M('<div class="p-6 text-muted-foreground">Loading…</div>');function cN(n,e){ce(e,!0);const t=ss(),r=U(()=>mr.params.slug??""),i=U(()=>t.config.pages[l(r)]);let o=X(null),s=X(null);nt(()=>{A(o,null),A(s,null),l(i)&&Xu(l(i).path,t.importMap).then(p=>{A(o,p,!0)}).catch(p=>{A(s,p instanceof Error?p.message:String(p),!0),console.error(`[quoin:CustomPageView] Failed to load "${l(r)}":`,p)})});var a=te(),u=q(a);{var c=p=>{Xp(p,{})},d=p=>{var v=lN(),m=w(v);G(()=>$(m,`Failed to load page: ${l(s)??""}`)),y(p,v)},f=p=>{const v=U(()=>l(o));var m=te(),h=q(m);Vt(h,()=>l(v),(x,_)=>{_(x,{})}),y(p,m)},g=p=>{var v=uN();y(p,v)};W(u,p=>{l(i)?l(s)?p(d,1):l(o)?p(f,2):p(g,-1):p(c)})}y(n,a),de()}var dN=M("<!> <!>",1);function fN(n,e){ce(e,!0),Qb({config:e.config,importMap:e.importMap}),ex(),Jb([{pattern:"/login"},{pattern:"/pages/:slug"},{pattern:"/globals/:key"},{pattern:"/:collection/:id/versions/:vid"},{pattern:"/:collection/:id/versions"},{pattern:"/:collection/new"},{pattern:"/:collection/:id"},{pattern:"/:collection"},{pattern:"/"}]);const r=U(()=>mr.path);var i=dN(),o=q(i);Wb(o,{position:"top-right",richColors:!0,closeButton:!0});var s=N(o,2);{var a=c=>{dx(c,{})},u=c=>{Dx(c,{children:(d,f)=>{var g=te(),p=q(g);{var v=R=>{Ux(R,{})},m=R=>{cN(R,{})},h=U(()=>l(r).startsWith("/pages/")),x=R=>{sN(R,{})},_=U(()=>l(r).startsWith("/globals/")),S=R=>{tN(R,{})},k=U(()=>/^\/[^/]+\/[^/]+\/versions\/[^/]+$/.test(l(r))),b=R=>{wT(R,{})},C=U(()=>/^\/[^/]+\/[^/]+\/versions$/.test(l(r))),T=R=>{sT(R,{})},O=U(()=>/^\/[^/]+\/new$/.test(l(r))),E=R=>{fT(R,{})},D=U(()=>/^\/[^/]+\/[^/]+$/.test(l(r))),L=R=>{M0(R,{})},V=U(()=>/^\/[^/]+$/.test(l(r))),J=R=>{Xp(R,{})};W(p,R=>{l(r)==="/"?R(v):l(h)?R(m,1):l(_)?R(x,2):l(k)?R(S,3):l(C)?R(b,4):l(O)?R(T,5):l(D)?R(E,6):l(V)?R(L,7):R(J,-1)})}y(d,g)},$$slots:{default:!0}})};W(s,c=>{l(r)==="/login"?c(a):c(u,-1)})}y(n,i),de()}const Qp={apiBase:"/api",basePath:"/admin",buildOutDir:"./dist",devPort:5173,brand:{name:"Quoin",logo:null},fields:{},slots:{},views:{},pages:{}},gN={};Hb(Qp.basePath);Zb();const $p=document.getElementById("app");if(!$p)throw new Error("#app mount target not found in index.html");gh(fN,{target:$p,props:{config:Qp,importMap:gN}});
|